Hello, after finishing my server/client project, i am concerned about the security of this system. I will run in an local/closed network which can be accessed via VPN. At the moment everybody can send data to the server via telnet or the written client application.

Can somebody explain how to upgrade my server/client code to ssl?

server:
Qt Code:
  1. #include "myserver.h"
  2.  
  3. myServer::myServer(QObject *parent) :
  4. QTcpServer(parent)
  5. {
  6. }
  7.  
  8. void myServer::startServer()
  9. {
  10. if(listen(QHostAddress::Any,1234))
  11. {
  12. qDebug()<< "Server online";
  13. }
  14. else
  15. {
  16. qDebug() << "Server offline";
  17. }
  18. }
  19.  
  20. void myServer::incomingConnection(qintptr handle)
  21. {
  22. myClient *client = new myClient(this);
  23. client->setSocket(handle);
  24.  
  25. connect(client,SIGNAL(client_done()),this,SLOT(done()));
  26.  
  27. }
  28.  
  29. void myServer::done()
  30. {
  31. qDebug() << "Refresh";
  32. emit refreshing();
  33. }
To copy to clipboard, switch view to plain text mode 

client:
Qt Code:
  1. #include "myclient.h"
  2. #include <iostream>
  3. #include <fstream>
  4. #include <string>
  5. #include <QFile>
  6. #include <QTextStream>
  7.  
  8. using namespace std;
  9.  
  10. myClient::myClient(QObject *parent) :
  11. QObject(parent)
  12. {
  13. socket = new QTcpSocket(this);
  14. socket->connectToHost("192.168.1.109", 1234);
  15.  
  16. qDebug() << "Connected to Server";
  17. }
  18.  
  19. void myClient::sendSocket()
  20. {
  21. string line;
  22.  
  23. ifstream myfile ("send.txt");
  24. if (myfile.is_open())
  25. {
  26. while (getline (myfile,line))
  27. {
  28. if( socket->waitForConnected() )
  29. {
  30. socket->write(line.c_str());
  31. qDebug() << QString::fromStdString(line);
  32. socket->write("\n");
  33. }
  34.  
  35. }
  36. myfile.close();
  37. }
  38.  
  39. qDebug() << "Data transfere completed";
  40. }
To copy to clipboard, switch view to plain text mode