Restrict QSslSocket to accept only from defined IP or local host. How?
-
@bogong
So far as I know not at theQSslSocket
level at least (OS may have some way of doing this). It's your job if you want to do this to look at the client's IP address and reject/close the connection if not acceptable.@JonB From what is written in OFDoc you right ...
Found only solution to use QSslServer https://doc.qt.io/qt-6/qabstractsocket.html#peerAddress It's returning on signal. Description of it is in here https://forum.qt.io/topic/1750/qtcpserver-incomingconnection-get-ip-address/3 And it's only since Qt 6.4
-
Hello all!
Is there any way to restrict QSslSocket to accept only incoming from defined IP or local host? Need to accept connections only from registered IP or from local host. Any examples would be perfect.
-
@bogong
So far as I know not at theQSslSocket
level at least (OS may have some way of doing this). It's your job if you want to do this to look at the client's IP address and reject/close the connection if not acceptable.@JonB From what is written in OFDoc you right ...
Found only solution to use QSslServer https://doc.qt.io/qt-6/qabstractsocket.html#peerAddress It's returning on signal. Description of it is in here https://forum.qt.io/topic/1750/qtcpserver-incomingconnection-get-ip-address/3 And it's only since Qt 6.4
-
-
@JonB From what is written in OFDoc you right ...
Found only solution to use QSslServer https://doc.qt.io/qt-6/qabstractsocket.html#peerAddress It's returning on signal. Description of it is in here https://forum.qt.io/topic/1750/qtcpserver-incomingconnection-get-ip-address/3 And it's only since Qt 6.4