Fix the location of the SSL files used for the websocket server.

This commit is contained in:
Ken Moore
2016-02-22 13:13:47 -05:00
parent b2cd436269
commit 2e64d2d0a6
2 changed files with 5 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ bool WebServer::setupWebSocket(quint16 port){
WSServer = new QWebSocketServer("sysadm-server", QWebSocketServer::SecureMode, this);
//SSL Configuration
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
QFile CF( QStringLiteral(SSLCERTFILE) );
QFile CF( QStringLiteral(SSLCERTFILEWS) );
if(CF.open(QIODevice::ReadOnly) ){
QSslCertificate CERT(&CF,QSsl::Pem);
config.setLocalCertificate( CERT );
@@ -65,7 +65,7 @@ bool WebServer::setupWebSocket(quint16 port){
}else{
qWarning() << "Could not read WS certificate file:" << CF.fileName();
}
QFile KF( QStringLiteral(SSLKEYFILE));
QFile KF( QStringLiteral(SSLKEYFILEWS));
if(KF.open(QIODevice::ReadOnly) ){
QSslKey KEY(&KF, QSsl::Rsa, QSsl::Pem);
config.setPrivateKey( KEY );

View File

@@ -53,6 +53,9 @@
#define SSLCERTFILE "/usr/local/etc/sysadm/restserver.crt"
#define SSLKEYFILE "/usr/local/etc/sysadm/restserver.key"
#define SSLCERTFILEWS "/usr/local/etc/sysadm/wsserver.crt"
#define SSLKEYFILEWS "/usr/local/etc/sysadm/wsserver.key"
// Server Settings defines
#define DISPATCH_QUEUE "/usr/local/etc/sysadm/dispatch_queue"