<div dir="ltr">Hi Nicolas,<div><br></div><div>Apologies for the late response. A few things:</div><div><br></div><div>1) I'm sorry you hate this particularly annoying problem.  It's especially prevalent on Windows, where Python itself ships some SSL root certificates to use to verify SSL resources on the internet.  Unfortunately if your Python installation is too old, the certificates it ships with might be expired.</div><div><br></div><div>2) It looks like you're using a very old version of Astropy, on Python 2.7, which is deprecated.  As soon as possible you should upgrade to Python 3; Python 3.7 is probably the most stable for most software you use, if not Python 3.8.</div><div><br></div><div>3) That said, you might be stuck on Python 2.7 for reasons I cannot know.  And even if you were on a newer version of Python it might still be a problem.  This is a known issue in Astropy which has a fix at [1] which will be included in Astropy v4.3.0</div><div><br></div><div>4) There is a potential workaround, though mind you I have not tested it since I don't have Python 2.7 on Windows anymore.  The workaround is to use the certifi [2] package, which provides up-to-date SSL root certificates in a manner which is easy to use by Python [3].  Its source releases should still work on Python 2.7.  The next step is you need to "monkey patch" the `ssl` module of Python to ensure that it always uses the certificates from certifi.  Here's a way you can do that; you would run this in your script before trying to do anything with astropy.time:</div><div><br></div><div>First you need to install certifi:</div><div><br></div><div>```</div><div>> python2.7 -m pip install certifi</div><div>```</div><div><br></div><div>Then in your Python code:</div><div><br></div><div>```</div><div>import certifi</div><div>import ssl</div><div>orig_create_default_context = ssl.create_default_context</div><div><br></div><div>def create_default_context(**kwargs):</div><div>    kwargs['cafile'] = certifi.where()</div><div>    return orig_create_default_context(**kwargs)</div><div><br></div><div>ssl.create_default_context = create_default_context</div><div>```</div><div><br></div><div>I believe this should work, but again I stress that it is untested.  Give it a try and see if it resolves the issue for you, and please report back here whether it works or not.</div><div><br></div><div>Nevertheless I would encourage you to upgrade to Python 3 as soon as possible.</div><div><br></div><div>Best,</div><div>Madison</div><div><br></div><div>[1] <a href="https://github.com/astropy/astropy/pull/10434">https://github.com/astropy/astropy/pull/10434</a></div><div>[2] <a href="https://pypi.org/project/certifi/">https://pypi.org/project/certifi/</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 18, 2020 at 7:26 PM Nicola Montecchiari <<a href="mailto:omega.centauri@gmail.com">omega.centauri@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello everybody,<div><br></div><div>after some months I am getting again an error while trying to connect to the IERS.</div><div><br></div><div><font face="monospace">Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:19:08) [MSC v.1500 32 bit (Intel)] on win32<br>astropy==2.0.16<br>numpy==1.16.6<br><br>>>> from astropy.time import Time<br>>>> t = Time('2016:001')<br>>>> t.ut1<br>WARNING: failed to download <a href="https://datacenter.iers.org/data/9/finals2000A.all" target="_blank">https://datacenter.iers.org/data/9/finals2000A.all</a> and <a href="ftp://cddis.gsfc.nasa.gov/pub/products/iers/finals2000A.all" target="_blank">ftp://cddis.gsfc.nasa.gov/pub/products/iers/finals2000A.all</a>, using local IERS-B: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>;<urlopen error ftp error: timed out> [astropy.utils.iers.iers]<br><Time object: scale='ut1' format='yday' value=2016:001:00:00:00.082></font><br clear="all"><div><br></div><div>Is this a known issue?</div><div>Thanks a lot for your help</div><div>Nicola<br></div></div></div><div id="gmail-m_-2678403154958117125DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid rgb(211,212,222)">
        <tbody><tr>
      <td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:17px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Mail priva di virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a>             </td>
        </tr>
</tbody></table>
<a href="#m_-2678403154958117125_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@python.org" target="_blank">AstroPy@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/astropy</a><br>
</blockquote></div>