try to detect if ssl will not work before accepting ssl connections

This commit is contained in:
ps 2011-10-03 20:31:47 +00:00
parent 07eaaab646
commit a34bd2ac7b
2 changed files with 4 additions and 0 deletions

View File

@ -169,6 +169,9 @@ void Socket::prepareSSL(bool server)
if(1!=SSL_set_fd(ssl,fd))
throw Exception(_("Error setting FD"),__FILE__,__LINE__);
if(0==RAND_status())
throw Exception(_("PRNG has not enough data. Are you missing /dev/[u]random?"),__FILE__,__LINE__);
}
/**

View File

@ -40,6 +40,7 @@
#include <errno.h>
#ifdef HAVE_SSL
#include <openssl/ssl.h>
#include <openssl/rand.h>
#endif //HAVE_SSL
//this is a bit of a hack