sslcertverificationerror& Urlerror
过去,我将Web应用程序部署到Google App Engine,效果很好。我最近不得不对Python代码进行一些更改,它在本地运行良好,并且再次部署它,有些图表不会显示。 ()。
检查错误报告:它显示两个错误
sslcertverificationerror:[ssl:cetult_verify_failed]证书验证验证失败:主机名不匹配,证书对于'www.celerterak.org'''。 (_SSL.C:1129)
-
urlerror:< urlopen错误[ssl:cielder_verify_failed]证书验证验证失败:hostname不合格,证书对'www.celestrak.org''有效。 (_SSL.C:1129)。
请查看错误的详细信息
?返回两个图表
`@app.callback(
Output('satellite map', 'figure'),
Output('altitude chart', 'figure'),
Input('interval-component', 'n_intervals'),
Input('satellites dropdown', 'value'))
def plot_map(n,satellite_name):
try:
lon_list = []
lat_list = []
alt_list = []
obj_name_list = []
time_list = []
time = datetime.now()
orb = Orbital(satellite_name)
lon, lat = orb.get_lonlatalt(time)[0], orb.get_lonlatalt(time)[1]
lon_list.append(lon)
lat_list.append(lat)
obj_name_list.append(satellite_name)
for i in range(121):
time_list.append(time-timedelta(minutes = i))
for i in time_list:
alt_list.append(orb.get_lonlatalt(i)[2])
df_4 = pd.DataFrame({'ObjectName': obj_name_list, 'Latitude': lat_list, 'Longitude': lon_list})
df_5 = pd.DataFrame({'TimeStamp': time_list, 'Altitude': alt_list})
lon_list.clear()
lat_list.clear()
alt_list.clear()
time_list.clear()
obj_name_list.clear()
df_4_copy = df_4.copy()
df_5_copy = df_5.copy()
fig =go.Figure(go.Scattermapbox(
lat = df_4_copy['Latitude'], lon = df_4_copy['Longitude'], marker = {'size': 20, 'symbol':'rocket'},
hovertext = df_4_copy['ObjectName'],
)
)
fig.update_layout(
mapbox = {'accesstoken':api_token,
'style': 'light', 'zoom': 0,
},
margin = dict(l = 0, r =0, t = 0, b = 0),
height = 800, hovermode = 'closest')
fig2 = go.Figure(go.Scatter(x = df_5_copy['TimeStamp'], y = df_5_copy['Altitude']))
fig2.update_layout(margin = dict(l = 20, r = 20, t = 20, b = 20),
plot_bgcolor = 'rgb(255,255,255)', paper_bgcolor = 'rgb(255,255,255)',
height = 800, title = {'text': 'Altitude Trend of' + ' ' + str(satellite_name) + ' ' + 'in near real time', 'x':0.5, 'y':0.98},
).update_yaxes(gridcolor = 'rgb(243,243,243)', title ='Altitude (km)').update_xaxes(title = 'Timestamp', linecolor = 'rgb(243,243,243)')
return fig, fig2
except NotImplementedError:
pass`
完整代码在这里: https://github.com/0ladayo/low-earth-orbit-satellites-project/blob/master/mains/main.py
我在网上尝试了一些建议的解决方案,无用
。
谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎问题是
pyorbital
使用错误的端点的库使SSL问题出现。现在已经有一个发布。
这就是应用程序检索数据时失败的原因。
It seems the issue was with the
pyorbital
library which was using the wrong endpoints making the SSL issue appear.For now there is already a fix and now it is released.
This is the reason the app was failing when retrieving data.
Update
基于评论,OP不拥有该域,这意味着OP不负责获得多域SSL或使用Google Cloud提供的SSL。我正在罢工以前的答案。
似乎OP的代码正在尝试加载其域为
https://celestrak.org
的URL,但是该域的SSL实际上是用于https://celestrak.com < /代码>。但还不能弄清楚。
1. Your domain is a ```.org``` i.e. ```http://celestrak.org/``` but the certificate was issued to a ```.com``` i.e. ```http://celestrak.com/```. I believe you'll need a multi-domain certificate else you should change the certificate to your domain which ends in ```.org```
console.cloud.google.com
,选择您的项目,然后导航App Engine&GT;设置&gt;自定义域
,选择您的自定义域,然后单击启用托管安全
。注意:您不会在Firefox中获得错配证书错误。 Firefox简单地将您的网站更改为
http
Update
Based on the comments, OP doesn't own the domain which means OP is not responsible for getting a multi-domain SSL or using the SSL provided by google cloud. I am striking out the previous answer.
It seems like OP's code is attempting to load urls whose domain is
https://celestrak.org
but the SSL for that domain is actually forhttps://celestrak.com
. But can't figure it out yet.1. Your domain is a ```.org``` i.e. ```http://celestrak.org/``` but the certificate was issued to a ```.com``` i.e. ```http://celestrak.com/```. I believe you'll need a multi-domain certificate else you should change the certificate to your domain which ends in ```.org```
console.cloud.google.com
, select your project, then navigateApp Engine > Settings > Custom Domains
, select your custom domain and click theEnable Managed Security
.Note: You won't get the mismatched certificate error in Firefox. Firefox simply changes your site to
http