Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, March 2007
Example of a QSslSocket on the server side?


Message 1 in thread

I have been unable to get QSslSocket to work on the server side, using 
it in conjunction with QTcpServer::incomingConnection(). It crashes on 
QSslSocket::startServerHandShake(). I've submitted a bug report to 
Trolltech, but I'm curious if anyone has gotten a QSslSocket working on 
the server side, and if they could share some example code? The examples 
shipped with 4.3.0 only include a QSslSocket client side for now.

In the mean time, I've tried everything I can think of, including all 
permutations of setCaCertificate() setPrivateKey() and 
setSocketDescritor() (using the descriptor passed in 
incomingConnection()) in all orders prior to startServerHandShake() and 
none of them have worked (i.e., they all result in a crash). I think the 
problem is truly a bug in the QSslSocket code, but I'd like to see a 
working example help nail the problem down. Anyone have one?

--Dave

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 2 in thread

Dave Smith wrote:
> I have been unable to get QSslSocket to work on the server side, using
> it in conjunction with QTcpServer::incomingConnection(). It crashes on
> QSslSocket::startServerHandShake(). I've submitted a bug report to
> Trolltech, but I'm curious if anyone has gotten a QSslSocket working on
> the server side, and if they could share some example code? The examples
> shipped with 4.3.0 only include a QSslSocket client side for now.
> In the mean time, I've tried everything I can think of, including all
> permutations of setCaCertificate() setPrivateKey() and
> setSocketDescritor() (using the descriptor passed in
> incomingConnection()) in all orders prior to startServerHandShake() and
> none of them have worked (i.e., they all result in a crash). I think the
> problem is truly a bug in the QSslSocket code, but I'd like to see a
> working example help nail the problem down. Anyone have one?

Hi, Dave. As you have noticed, QSslSocket is still in a preliminary state in
the beta; we are working hard to finish it, and hopefully your problems
will be resolved shortly. Admittedly we hadn't tested server side SSL
properly before the beta was released.

We hope to have our SSL examples ready for Qt 4.3.0. In the mean time, you
should be able to use the existing TCP server examples, and as you probably
have tried, replace QTcpSocket with QSslSocket in the incomingConnection()
function, and after the setSocketDescriptor() call, call
startServerHandShake(). When QSslSocket emits encrypted(), the session
should be ready. Although from local testing, I can see there are still
problems.

Andreas

-- 
 [ signature omitted ]