return 1;
}
-#if ENABLE_SSL
-int cs_set_ssl_ctx(COMSTACK cs, void *ctx)
+void *cs_get_ssl(COMSTACK cs)
{
+#if HAVE_OPENSSL_SSL_H
struct tcpip_state *sp;
if (!cs || cs->type != ssl_type)
return 0;
sp = (struct tcpip_state *) cs->cprivate;
- if (sp->ctx_alloc)
- return 0;
- sp->ctx = (SSL_CTX *) ctx;
- return 1;
+ return sp->ssl;
+#else
+ return 0;
+#endif
}
-void *cs_get_ssl(COMSTACK cs)
+#if ENABLE_SSL
+int cs_set_ssl_ctx(COMSTACK cs, void *ctx)
{
struct tcpip_state *sp;
if (!cs || cs->type != ssl_type)
return 0;
sp = (struct tcpip_state *) cs->cprivate;
- return sp->ssl;
+ if (sp->ctx_alloc)
+ return 0;
+ sp->ctx = (SSL_CTX *) ctx;
+ return 1;
}
int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname)
return 0;
}
-void *cs_get_ssl(COMSTACK cs)
-{
- return 0;
-}
-
int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len)
{
return 0;