Addes SSL Support

This commit is contained in:
2018-05-19 13:38:44 +02:00
parent 0c2590b3f5
commit 272697d9e5
3 changed files with 65 additions and 8 deletions

View File

@ -11,10 +11,14 @@
#include <thread>
#include <sys/time.h>
#include <sys/stat.h>
#include <bits/signum.h>
#include <csignal>
using namespace std;
/**
* Returns UNIX time in microseconds
* @return UNIX time [µs]
@ -48,6 +52,8 @@ string getMimeType(string path) {
}
}
magic_close(magic);
return type + "; charset=" + charset;
}
@ -115,9 +121,17 @@ string getWebRoot(string host) {
long clientnum = 0;
int main() {
SSL_load_error_strings();
SSL_library_init();
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
signal(SIGPIPE, SIG_IGN);
cout << "Necronda Server 3.0" << endl << "by Lorenz Stechauner" << endl << endl;
unsigned short PORT = 8080;
unsigned short PORT = 443;
Socket *s;
try {