question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client support for connecting to HTTPS

See original GitHub issue

Hi,

I am attempting to connect via the python Socket.IO client to a an HTTPS Socket.IO JavaScript server. When connecting via an HTTP link it works fine, but HTTPS returns “connection refused by server”. The equivalent JavaScript client code however is able to connect to HTTPS, so I do not believe the issue is server side.

Here is my python-socketio client code

import socketio

sio = socketio.Client();

@sio.event
def connect():
    print('connection established')

@sio.event
def disconnect():
    print('disconnected from server')

sio.connect('https://myUrl.com')
sio.wait()

And here is the equivalent functioning JavaScript code

const io = require('socket.io-client');
const socket = io.connect('https://myUrl.com', {
    secure: true,
    reconnect: true,
    rejectUnauthorized: false});
socket.on('connect', function() {
    console.log("the client connected");
});
socket.on('disconnect', function() {
    console.log("the client disconnected");
});
socket.on('test', function(data) {
    console.log(data)
});

Is there an equivalent to the io.connect options being passed through in JavaScript that needs to be enabled on the python equivalent?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
vgonisanzcommented, Oct 21, 2019

It seems that the dependency python-engineio add an option ssl_verify at commit 51da0bed3c93c41b980bb565560c7233da3501f5 . Currently the last version of the library is python-engineio==3.9.3 and the change is not added yet.

It works right now if update script python-engineio/engineio/client.py for this version and connect using:

socketio.Client(engineio_logger=True, logger=True, ssl_verify=False)
5reactions
miguelgrinbergcommented, Oct 21, 2019

Correct. Next version of python-engineio will support a disable SSL verification option. Coming out later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting Up a Client to Consume a Web Service Over an SSL ...
There are some additional steps that need to be performed when setting up a client application to consume a Web service over a...
Read more >
Enabling HTTPS on your servers - web.dev
If you have been using distinct IP addresses for each hostname, you can easily support both HTTP and HTTPS for all clients.
Read more >
C HTTP/HTTPS Support
C HTTP/HTTPS Support ... Message Queue includes support for Java clients to communicate with a message broker by means of the HTTP or...
Read more >
Securing Connections for Client and Server - MariaDB
See Secure Connections Overview to determine how to check whether a server was compiled with TLS support.
Read more >
HTTPS Client Authentication (The Java EE 6 Tutorial, Volume I)
HTTPS Client Authentication is a more secure method of authentication than either basic or form-based authentication. It uses HTTP over SSL (HTTPS), in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found