diff --git a/ltls.pbi b/ltls.pbi index 47cde36..c4cfc80 100644 --- a/ltls.pbi +++ b/ltls.pbi @@ -10,7 +10,7 @@ DeclareModule ltls Password.s EndStructure - + Declare InitSimpleTLS(CA.s, Cert.s, Key.s, Password.s, TLSID.i = 0) Declare InitTLS(*Settings.s_tls_server, TLSID.i = 0) Declare WaitTLSSocket(ServerSocket.i, TLSID.i = 0) Declare ReadTLSSocket(Connection.i, *Buffer, Length.i) @@ -95,6 +95,17 @@ Module ltls Global tls_cfg = #Null Global tls_ctx = #Null + Procedure InitSimpleTLS(CA.s, Cert.s, Key.s, Password.s, TLSID.i = 0) + Define Settings.s_tls_server + Define TLSInitReturn.i + Settings\CA = CA + Settings\Cert = Cert + Settings\Key = Key + Settings\Password = Password + TLSInitReturn = InitTLS(@Settings, TLSID) + ProcedureReturn TLSInitReturn + EndProcedure + Procedure InitTLS(*Settings.s_tls_server, TLSID.i = 0) Protected mem_ptr.i, length.i, returns.i If tls_init() <> 0 : ProcedureReturn -1 : EndIf