Hi

I've got one question. I have to write some code with SSL communication, but there is one big problem. I've got few different certificates and privates keys. I can get correct certificate after I receive from client some important info. After that I chose correct certificate, private key and start socket encryption.

on server side I have

Qt Code:
  1. QSslSocket* pSocket = new QSslSocket(this);
  2. pSocket->setSocketDescriptor(m_nextSocketDesc);
  3. pSocket->startServerEncryption();
To copy to clipboard, switch view to plain text mode 

on client side
Qt Code:
  1. m_pSslSocket->connectToHost(address, port);
To copy to clipboard, switch view to plain text mode 

I was thinking, that after i receive some info i just add correct certificate and start client encryption.
But after client connects to server, server immediately disconnects client and emits errors;
Any suggestions?