sslcertverificationerror& Urlerror

发布于 2025-02-14 02:15:42 字数 3126 浏览 0 评论 0 原文

过去,我将Web应用程序部署到Google App Engine,效果很好。我最近不得不对Python代码进行一些更改,它在本地运行良好,并且再次部署它,有些图表不会显示。 ()。

检查错误报告:它显示两个错误

  1. sslcertverificationerror:[ssl:cetult_verify_failed]证书验证验证失败:主机名不匹配,证书对于'www.celerterak.org'''。 (_SSL.C:1129)

  2. 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

我在网上尝试了一些建议的解决方案,无用

谢谢。

I deployed a web app to the google app engine in the past and it works fine. I recently had to make some changes to the python code, it runs fine locally and upon deploying it again, some charts don't show up. (https://leo-satellite-overview.nw.r.appspot.com/).

Checking the Error Reporting: It's showing two errors

  1. SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.celestrak.org'. (_ssl.c:1129)

  2. URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.celestrak.org'. (_ssl.c:1129).

Please see details of the errors link

See the code that returns the two charts

`@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`

The full code is here: https://github.com/0ladayo/Low-Earth-Orbit-Satellites-Project/blob/master/main.py

I have tried some suggested solutions on the web to no avail.

Can anyone help

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

反话 2025-02-21 02:15:42

似乎问题是 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.

故事↓在人 2025-02-21 02:15:42

Update

  1. 基于评论,OP不拥有该域,这意味着OP不负责获得多域SSL或使用Google Cloud提供的SSL。我正在罢工以前的答案。

  2. 似乎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```

  1. 另一个选项是使用Google Cloud发出的SSL证书,即登录到 console.cloud.google.com ,选择您的项目,然后导航 App Engine&GT;设置&gt;自定义域,选择您的自定义域,然后单击启用托管安全

注意:您不会在Firefox中获得错配证书错误。 Firefox简单地将您的网站更改为 http

Update

  1. 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.

  2. 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 for https://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```

  1. Another option is to use the Google Cloud issued SSL certificate i.e. login to console.cloud.google.com, select your project, then navigate App Engine > Settings > Custom Domains, select your custom domain and click the Enable Managed Security.

Note: You won't get the mismatched certificate error in Firefox. Firefox simply changes your site to http

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文