Skip to content

TestStandardProfileHTTPSHub error after upgrade of OpenSSL to 1.1.0 #5460

Closed

Description

@olebole

With the latest release on Python (taken from 20161103 according to the Changelog), TestStandardProfileHTTPSHub.test_main gives an error on setup:

__________ ERROR at setup of TestStandardProfileHTTPSHub.test_main ____________

self = <astropy.vo.samp.tests.test_standard_profile.TestStandardProfileHTTPSHub object at 0x7f69515e9d90>
method = <bound method TestStandardProfileHTTPSHub.test_main of <astropy.vo.samp.tests.test_standard_profile.TestStandardProfileHTTPSHub object at 0x7f69515e9d90>>

    def setup_method(self, method):
        self.tmpdir = tempfile.mkdtemp()
        self.hub = SAMPHubServer(web_profile=False, mode='multiple', pool_size=1,
                                 **self.hub_init_kwargs)
        self.hub.start()
        self.client1 = SAMPIntegratedClient(**self.client_init_kwargs)
>       self.client1.connect(hub=self.hub, pool_size=1, **self.client_connect_kwargs)

/usr/lib/python2.7/dist-packages/astropy/vo/samp/tests/test_standard_profile.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python2.7/dist-packages/astropy/vo/samp/integrated_client.py:184: in connect
    cert_reqs, ca_certs, ssl_version, pool_size)
/usr/lib/python2.7/dist-packages/astropy/vo/samp/hub_proxy.py:128: in connect
    self.ping()
/usr/lib/python2.7/dist-packages/astropy/vo/samp/hub_proxy.py:165: in ping
    return self._samp_hub.ping()
/usr/lib/python2.7/dist-packages/astropy/vo/samp/utils.py:65: in __call__
    response = function(*args, **kwrds)
/usr/lib/python2.7/xmlrpclib.py:1243: in __call__
    return self.__send(self.__name, args)
[...]
/usr/lib/python2.7/httplib.py:844: in send
    self.connect()
/usr/lib/python2.7/dist-packages/astropy/vo/samp/ssl_utils.py:62: in connect
    sslconn = ssl.wrap_socket(sock, **kwargs)
/usr/lib/python2.7/ssl.py:943: in wrap_socket
    ciphers=ciphers)
/usr/lib/python2.7/ssl.py:611: in __init__
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ssl.SSLSocket object at 0x7f69503f8d70>, block = False

    def do_handshake(self, block=False):
        """Perform a TLS/SSL handshake."""
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           error: [Errno 104] Connection reset by peer

/usr/lib/python2.7/ssl.py:840: error

where the captures stdout also just shows a

INFO: Hub set for using SSL. [astropy.vo.samp.hub]
INFO: Hub started [astropy.vo.samp.hub]
________ ERROR at setup of TestStandardProfileHTTPSHubClient.test_main _________

self = <astropy.vo.samp.tests.test_standard_profile.TestStandardProfileHTTPSHubClient object at 0x7f6950413490>
method = <bound method TestStandardProfileHTTPSHubClient.test_main of <astropy.vo.samp....t_standard_profile.TestStandardProfileHTTPSHubClient object at 0x7f6950413490>>

    def setup_method(self, method):
        self.tmpdir = tempfile.mkdtemp()
        self.hub = SAMPHubServer(web_profile=False, mode='multiple', pool_size=1,
                                 **self.hub_init_kwargs)
        self.hub.start()
    
        self.client1 = SAMPIntegratedClient(**self.client_init_kwargs)
>       self.client1.connect(hub=self.hub, pool_size=1, **self.client_connect_kwargs)

/usr/lib/python2.7/dist-packages/astropy/vo/samp/tests/test_standard_profile.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python2.7/dist-packages/astropy/vo/samp/integrated_client.py:184: in connect
    cert_reqs, ca_certs, ssl_version, pool_size)
/usr/lib/python2.7/dist-packages/astropy/vo/samp/hub_proxy.py:128: in connect
    self.ping()
/usr/lib/python2.7/dist-packages/astropy/vo/samp/hub_proxy.py:165: in ping
    return self._samp_hub.ping()
/usr/lib/python2.7/dist-packages/astropy/vo/samp/utils.py:65: in __call__
    response = function(*args, **kwrds)
/usr/lib/python2.7/xmlrpclib.py:1243: in __call__
    return self.__send(self.__name, args)
[...]
/usr/lib/python2.7/httplib.py:844: in send
    self.connect()
/usr/lib/python2.7/dist-packages/astropy/vo/samp/ssl_utils.py:62: in connect
    sslconn = ssl.wrap_socket(sock, **kwargs)
/usr/lib/python2.7/ssl.py:943: in wrap_socket
    ciphers=ciphers)
/usr/lib/python2.7/ssl.py:611: in __init__
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ssl.SSLSocket object at 0x7f6950491b18>, block = False

    def do_handshake(self, block=False):
        """Perform a TLS/SSL handshake."""
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           error: [Errno 104] Connection reset by peer

/usr/lib/python2.7/ssl.py:840: error

On Python-3.5, the behaviour is the same.

Main change in Python was the use of OpenSSL 1.0. The Python-2.7 changelog shows a few more SSL related entries:

  • Issue #27691: Fix ssl module's parsing of GEN_RID subject alternative name fields in X.509 certs.
  • Issue #27850: Remove 3DES from ssl module's default cipher list to counter measure sweet32 attack (CVE-2016-2183).
  • Issue #27766: Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL 1.1.0 or LibreSSL).
  • Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0. Closes: #835793.

Full test log here

Activity

  1. eteq commented on Dec 13, 2016

    @eteq
    Member

    @pllim - any ideas here? The thing I really don't understand is why this is only vo, when it seems fairly generic...

  2. olebole commented on Dec 13, 2016

    @olebole
    MemberAuthor

    @eteq I run only non-remote tests; maybe this is the only one which starts its own server instead of connecting to remote?

  3. pllim commented on Dec 13, 2016

    @pllim
    Member

    Sorry, samp is @astrofrog, not me.

  4. added this to the v1.3.0 milestone on Dec 16, 2016
  5. self-assigned this
    on Dec 16, 2016
  6. astrofrog commented on Dec 23, 2016

    @astrofrog
    Member

    I won't have any time in the near future to work on this, but just in case anyone wants to take a look at this, there's now a bounty on this 😄 (as an experiment)

    BountySource

  7. modified the milestones: v1.3.0, v1.3.1 on Jan 4, 2017
  8. mhvk commented on Jan 6, 2017

    @mhvk
    Contributor

    Not sure I can help here, but it definitely is annoying as on my (Debian) machine I now always have this test failing. Could it be as simple as the test using a weak form of encryption that no longer is supported?

  9. removed this from the v1.3.1 milestone on Mar 4, 2017
  10. mhvk commented on Apr 21, 2017

    @mhvk
    Contributor

    @astrofrog - any chance you can have a look at this? It is very annoying to have the test suite broken on recent python versions.

    I guess more generally there is a problem for vo.samp that it seems to have a high bus factor...

  11. mhvk commented on May 17, 2017

    @mhvk
    Contributor

    Pending an actual solution, I made a PR (#6091) that disables the relevant vo.samp tests for openssl > 1.1; it is too unpleasant to have tests always fail with an up-to-date python installation. I wonder if we should even support having a VO server in astropy core; it seems more logical in an affiliated package.

  12. pllim commented on May 17, 2017

    @pllim
    Member

    I already moved Cone Search over to Astroquery, SAMP is the only thing remaining in astropy.vo.

  13. mhvk commented on May 17, 2017

    @mhvk
    Contributor

    Hmm, given that, my suggestion actually may make sense....

  14. pllim commented on Jun 12, 2017

    @pllim
    Member

    @mhvk , or at least move it to under astropy.io, like astropy.io.vosamp (we already have astropy.io.votable)? And then, we can get rid of astropy.vo altogether... Too controversial?

  15. astrofrog commented on Jun 12, 2017

    @astrofrog
    Member

    I would be fine with splitting this back out into an affiliated package if people would prefer that. Maybe it would be good to first get a show of hands on the list of who is using it?

  16. mhvk commented on Jun 12, 2017

    @mhvk
    Contributor

    To me, it makes sense to have this as an affiliated package, as it seems running one's own VO server is a bit overly specialized for the core. But I agree we should ping the mailing list.

  17. bsipocz commented on Jun 12, 2017

    @bsipocz
    Member

    If split is going to happen, can we make a deprecation in time for 2.0, so that actual removal can happen in 3.0?

  18. pllim commented on Jun 12, 2017

    @pllim
    Member

    can we make a deprecation in time for 2.0

    Is it alright to deprecate something that has no real replacement yet? I doubt the split is going to happen by Friday. How about a "pending deprecation" warning instead?

  19. bsipocz commented on Jun 12, 2017

    @bsipocz
    Member

    Well, technically the replacement need to be in place when the release is out, in ~3 weeks time, not by Friday :)

  20. pllim commented on Jun 12, 2017

    @pllim
    Member

    Well, this discussion is getting very out of topic here, let's discuss more at #6187.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions