Add InitSimpleTLS(CA, Cert, Key, Password, TLSID)
This commit is contained in:
parent
0e76942285
commit
402feb568c
1 changed files with 12 additions and 1 deletions
13
ltls.pbi
13
ltls.pbi
|
@ -10,7 +10,7 @@ DeclareModule ltls
|
||||||
Password.s
|
Password.s
|
||||||
EndStructure
|
EndStructure
|
||||||
|
|
||||||
|
Declare InitSimpleTLS(CA.s, Cert.s, Key.s, Password.s, TLSID.i = 0)
|
||||||
Declare InitTLS(*Settings.s_tls_server, TLSID.i = 0)
|
Declare InitTLS(*Settings.s_tls_server, TLSID.i = 0)
|
||||||
Declare WaitTLSSocket(ServerSocket.i, TLSID.i = 0)
|
Declare WaitTLSSocket(ServerSocket.i, TLSID.i = 0)
|
||||||
Declare ReadTLSSocket(Connection.i, *Buffer, Length.i)
|
Declare ReadTLSSocket(Connection.i, *Buffer, Length.i)
|
||||||
|
@ -95,6 +95,17 @@ Module ltls
|
||||||
Global tls_cfg = #Null
|
Global tls_cfg = #Null
|
||||||
Global tls_ctx = #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)
|
Procedure InitTLS(*Settings.s_tls_server, TLSID.i = 0)
|
||||||
Protected mem_ptr.i, length.i, returns.i
|
Protected mem_ptr.i, length.i, returns.i
|
||||||
If tls_init() <> 0 : ProcedureReturn -1 : EndIf
|
If tls_init() <> 0 : ProcedureReturn -1 : EndIf
|
||||||
|
|
Loading…
Reference in a new issue