-#elif HAVE_OPENSSL_SSL_H
- if (h->type == ssl_type && !sp->ctx)
- {
- SSL_library_init();
- SSL_load_error_strings();
-
- sp->ctx = sp->ctx_alloc = SSL_CTX_new(SSLv23_server_method());
- if (!sp->ctx)
- {
- h->cerrno = CSERRORSSL;
- return -1;
- }
- }
- if (sp->ctx)
- {
- if (sp->ctx_alloc)
- {
- int res;
- res = SSL_CTX_use_certificate_file(sp->ctx, sp->cert_fname,
- SSL_FILETYPE_PEM);
- if (res <= 0)
- {
- ERR_print_errors_fp(stderr);
- exit(2);
- }
- res = SSL_CTX_use_PrivateKey_file(sp->ctx, sp->cert_fname,
- SSL_FILETYPE_PEM);
- if (res <= 0)
- {
- ERR_print_errors_fp(stderr);
- exit(3);
- }
- res = SSL_CTX_check_private_key(sp->ctx);
- if (res <= 0)
- {
- ERR_print_errors_fp(stderr);
- exit(5);
- }
- }
- TRC(fprintf(stderr, "ssl_bind\n"));
- }
- else
- {
- TRC(fprintf(stderr, "tcpip_bind\n"));
- }