Просмотр исходного кода

* Fix cases that should be graceful failures when loading SSL

Bryan Drewery 15 лет назад
Родитель
Сommit
c9763c346f
1 измененных файлов с 9 добавлено и 4 удалено
  1. 9 4
      src/ssl.c

+ 9 - 4
src/ssl.c

@@ -93,10 +93,15 @@ int load_ssl() {
   SSL_load_error_strings();
   OpenSSL_add_ssl_algorithms();
   ssl_ctx = SSL_CTX_new(SSLv23_client_method());
-  if (!ssl_ctx)
-    fatal("SSL_CTX_new() failed",0);
-  if (seed_PRNG())
-    fatal("Wasn't able to properly seed the PRNG!",0);
+  if (!ssl_ctx) {
+    sdprintf("SSL_CTX_new() failed");
+    return 1;
+  }
+
+  if (seed_PRNG()) {
+    sdprintf("Wasn't able to properly seed the PRNG!");
+    return 1;
+  }
 #endif
 
   return 0;