Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?
-
Qt5 version : Qt5.12.2
aws instance : microsoft server 2019 Base, 64 bits*following ip address and port are fakes
Using QWebsocket to connect to the a server written by QWebSocketServer, the server listen to QHostAddress::AnyIPV4, port:3567
I try to connect to the server by QWebSocket as following
socket_.open("ws://11.22.33.44:3567"), 11.22.33.44 is the public address of the aws instance.
In order to make things easier to test, I create an inbound rule which enabled every TCP source with port 3567. But the QWebSocket always give me "QAbstractSocket.SocketError.NetworkError"
Do I need to do some special setup in order to connect to the AWS instance by websocket?Thanks
-
Qt5 version : Qt5.12.2
aws instance : microsoft server 2019 Base, 64 bits*following ip address and port are fakes
Using QWebsocket to connect to the a server written by QWebSocketServer, the server listen to QHostAddress::AnyIPV4, port:3567
I try to connect to the server by QWebSocket as following
socket_.open("ws://11.22.33.44:3567"), 11.22.33.44 is the public address of the aws instance.
In order to make things easier to test, I create an inbound rule which enabled every TCP source with port 3567. But the QWebSocket always give me "QAbstractSocket.SocketError.NetworkError"
Do I need to do some special setup in order to connect to the AWS instance by websocket?Thanks
@tham
i am not sure, but doesnt AWS enforce a secure connection? so try to usewss://...
Make sure that your AWS config allows the server to talk to the outside world.But the QWebSocket always give me "QAbstractSocket.SocketError.NetworkError"
check the errorString(), it may help with more details
-
Thanks, using Pyside2, do QWebSocket module of Pyside2 support ssl? I cannot found the sslError signal of QWebSocket and setSslConfiguration of QWebSocketServer.
ps : The app need to written by python, this is the requirements of the users
Edit : I post the question of ssl in this post, almost no one visit forum of PySide2
-
Thanks, using Pyside2, do QWebSocket module of Pyside2 support ssl? I cannot found the sslError signal of QWebSocket and setSslConfiguration of QWebSocketServer.
ps : The app need to written by python, this is the requirements of the users
Edit : I post the question of ssl in this post, almost no one visit forum of PySide2
@tham said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
Thanks, using Pyside2, do QWebSocket module of Pyside2 support ssl?
QtWebSocket does, and since its a binding i would expect so
-
@tham said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
Thanks, using Pyside2, do QWebSocket module of Pyside2 support ssl?
QtWebSocket does, and since its a binding i would expect so
@raven-worx said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
QtWebSocket does, and since its a binding i would expect so
But the client cannot connect to the server, always. This simple server/client example works well if written by c++
The weird thing is the client would output error message if the server shutdown
ssl client error code: PySide2.QtNetwork.QAbstractSocket.SocketError.RemoteHostClosedError , error msg: The remote host closed the connection
but it never able to to connect to the server.
Edit : found new error message after I remove the global dll of ssl. It output
ssl client error code: PySide2.QtNetwork.QAbstractSocket.SocketError.UnsupportedSocketOperationError , error msg: SSL Sockets are not supported on this platform.
Guess it do not support ssl on windows yet? Do anyone know these codes can work on ubuntu or not?
-
@raven-worx said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
QtWebSocket does, and since its a binding i would expect so
But the client cannot connect to the server, always. This simple server/client example works well if written by c++
The weird thing is the client would output error message if the server shutdown
ssl client error code: PySide2.QtNetwork.QAbstractSocket.SocketError.RemoteHostClosedError , error msg: The remote host closed the connection
but it never able to to connect to the server.
Edit : found new error message after I remove the global dll of ssl. It output
ssl client error code: PySide2.QtNetwork.QAbstractSocket.SocketError.UnsupportedSocketOperationError , error msg: SSL Sockets are not supported on this platform.
Guess it do not support ssl on windows yet? Do anyone know these codes can work on ubuntu or not?
@tham said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
Edit : found new error message after I remove the global dll of ssl. It output
isn't that an expected error when you remove the openssl libs?!?
-
@tham said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
Edit : found new error message after I remove the global dll of ssl. It output
isn't that an expected error when you remove the openssl libs?!?
@raven-worx Nope, I tried it with the c++ version, if I removed the dll, the client do not has any responses.
-
@raven-worx Nope, I tried it with the c++ version, if I removed the dll, the client do not has any responses.
@tham
then your C++ application finds an appropriate OpenSSL dll from somewhere else which your Py app doesn't. Qt definitely needs OpenSSL to make SSL work (unless you compiled Qt yourself and linked OpenSSL statically). -
@tham
then your C++ application finds an appropriate OpenSSL dll from somewhere else which your Py app doesn't. Qt definitely needs OpenSSL to make SSL work (unless you compiled Qt yourself and linked OpenSSL statically).@raven-worx I am using the same Qt5 version, Qt5.12.2, both of them should use the same dll. The Pyside2 is installed by pip, so it is builded by Qt company, unless they change the dll of Qt5.12.2 of pyside2 under the hood, else the same dll should work.
-
@raven-worx I am using the same Qt5 version, Qt5.12.2, both of them should use the same dll. The Pyside2 is installed by pip, so it is builded by Qt company, unless they change the dll of Qt5.12.2 of pyside2 under the hood, else the same dll should work.
@tham said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
I am using the same Qt5 version, Qt5.12.2, both of them should use the same dll
thats not how the DLL loading works. If the application can't find them either globally or relative to the executable it wont work.
But easiest would to check it. E.g. use ProcessExplorer and check the loaded DLLs of your 2 applications and compare them.
-
@tham said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
I am using the same Qt5 version, Qt5.12.2, both of them should use the same dll
thats not how the DLL loading works. If the application can't find them either globally or relative to the executable it wont work.
But easiest would to check it. E.g. use ProcessExplorer and check the loaded DLLs of your 2 applications and compare them.
@raven-worx Thanks, will check, however I think they load the same dll(c++ and pyside2), because the behaviors are different after/before I remove the dll, maybe a bug of pyside2.
-
@tham said in Anyone tried to connect to the QWebsocketserver run on aws ec2 instance?:
I am using the same Qt5 version, Qt5.12.2, both of them should use the same dll
thats not how the DLL loading works. If the application can't find them either globally or relative to the executable it wont work.
But easiest would to check it. E.g. use ProcessExplorer and check the loaded DLLs of your 2 applications and compare them.
@raven-worx Comfirm it with ProcessExplorer, I am sure c++ and pyside2 load the same ssl dll if I put the ssl dll into PATH.
Edit : Should I open a bug report on JIRA?
Edit2 : This seems like a known issue--Missing ssl support for QWebSocketServer and QWebSocket