我過去將一個網路應用程式部署到谷歌應用程式引擎,它作業正常。我最近不得不對 python 代碼進行一些更改,它在本地運行良好,再次部署后,一些圖表沒有顯示。(https://leo-satellite-overview.nw.r.appspot.com/)。
檢查錯誤報告:顯示兩個錯誤
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 證書驗證失敗:主機名不匹配,證書對“www.celestrak.org”無效。(_ssl.c:1129)
URLError:<urlopen 錯誤 [SSL:CERTIFICATE_VERIFY_FAILED] 證書驗證失敗:主機名不匹配,證書對“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,衛星名稱):
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/main.py
我在網上嘗試了一些建議的解決方案,但無濟于事。
誰能幫忙
謝謝你。
uj5u.com熱心網友回復:
似乎問題在于pyorbital
使用錯誤端點的庫導致出現 SSL 問題。
目前已經有一個修復程式,現在它已發布。
這就是應用程式在檢索資料時失敗的原因。
uj5u.com熱心網友回復:
更新
根據評論,OP 不擁有該域,這意味著 OP 不負責獲取多域 SSL 或使用谷歌云提供的 SSL。我正在洗掉以前的答案。
似乎 OP 的代碼正在嘗試加載其域為
https://celestrak.org
但該域的 SSL 實際上為https://celestrak.com
. 但還想不通。
- 另一種選擇是使用 Google Cloud 頒發的 SSL 證書,即登錄
console.cloud.google.com
,選擇您的專案,然后導航App Engine > Settings > Custom Domains
,選擇您的自定義域并單擊Enable Managed Security
。
注意:您不會在 Firefox 中收到不匹配的證書錯誤。Firefox 只是將您的網站更改為http
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/507775.html
標籤:Google Cloud Collective Python 谷歌应用引擎 谷歌云平台 ssl 证书