try to detect if ssl will not work before accepting ssl connections
This commit is contained in:
parent
07eaaab646
commit
a34bd2ac7b
|
@ -169,6 +169,9 @@ void Socket::prepareSSL(bool server)
|
||||||
|
|
||||||
if(1!=SSL_set_fd(ssl,fd))
|
if(1!=SSL_set_fd(ssl,fd))
|
||||||
throw Exception(_("Error setting FD"),__FILE__,__LINE__);
|
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__);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
#include <openssl/rand.h>
|
||||||
#endif //HAVE_SSL
|
#endif //HAVE_SSL
|
||||||
|
|
||||||
//this is a bit of a hack
|
//this is a bit of a hack
|
||||||
|
|
Loading…
Reference in a new issue