Skip to content

Self Signed SSL Cert with socketIO #54

Closed
@abufilba

Description

Hi.

I am trying to get socketio-client to connect to a local node.js server.

If I run straight http everything is fine.

If I attempt to access the server using https with Self Signed Certs I run into problems.
(I have a working python example connection to the server using urllib2 to post a JSON document so I am fairly sure it all works together.)

I want to use a self signed cert against node.js on my local machine (CN of the cert is the eventual domain)

If I specify a .pem file i.e.
verify='....../certs/server/server.pem'

with SocketIO('https://127.0.0.1:8443',
verify=verify,
cert=('certs/monitor/monitor.crt', 'certs/monitor/monitor.key')) as socketIO:

I get WARNING:socketIO_client:[waiting for connection] hostname '127.0.0.1' doesn't match u'

so its doing CN checking - can we disable this? I have started looking into the urllib3 connectionPooling code as there is an assert_hosts=False flag which should be applicable. However I cannot seem to make this work with socketIO.

If I use verify=False i.e.
SocketIO('https://127.0.0.1:8443',
verify=False,
cert=('certs/monitor/monitor.crt', 'certs/monitor/monitor.key')) as socketIO:

Then I get

WARNING:socketIO_client:[waiting for connection] [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

So it looks like verify is NOT being passed through successfully

in either case it seems to go into a loop attempting to access 127.0.0.1

Any help would be useful.

Excellent apart from that........

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions