Fix wolfSSL_Init return type and check

pull/66/head
Jeremiah Mackey 2026-04-02 16:00:08 +00:00
parent c81c839a24
commit e1ede238e4
2 changed files with 4 additions and 2 deletions

View File

@ -152,7 +152,9 @@ class SSLContext(object):
"""
def __init__(self, protocol, server_side=None):
_lib.wolfSSL_Init()
if _lib.wolfSSL_Init() != _SSL_SUCCESS:
raise RuntimeError(
"wolfSSL library initialization failed")
method = _WolfSSLMethod(protocol, server_side)
self.protocol = protocol

View File

@ -474,7 +474,7 @@ cdef += """
/*
* SSL/TLS Session functions
*/
void wolfSSL_Init();
int wolfSSL_Init(void);
WOLFSSL* wolfSSL_new(WOLFSSL_CTX*);
void wolfSSL_free(WOLFSSL*);