TLSContext (FB)
FUNCTION_BLOCK PUBLIC FINAL TLSContext IMPLEMENTS ITLSContext, ITLSContext_Internal
Encapsulates all the data neccecray to handle encrypted tcp connections
Static initialization, as shown in the following code snippet.
VAR
commonName : STRING := 'MyRrasPi';
ciCertInfo : NBS.CERT_INFO := (psInfo:=ADR(commonName), udiSize:=LEN(commonName));
myTLSContext : NBS.TLSContext := (
ePurpose:=NBS.PURPOSE.CLIENT_SIDE,
sUseCaseName:='NBSTest',
sTLSVersion:='1.3',
ciCertInfo:=ciCertInfo,
udiVerificationMode:=2
);
END_VAR
- InOut:
Scope
Name
Type
Initial
Comment
Input Const
sUseCaseNameSTRINGA name to identify this context in the security manager
ePurposeThis context can be used on the server side or on the client side.
sTLSVersion‘1.2’
A string to select the correct protocol version
sCipherListSTRUCT(psList := ADR(‘HIGH’), udiSize := 5)
A string to select the correct encryption cipher suites.sHostnameA hostname to select the correct certificate on the server side.
udiVerificationModeUDINT1
1 => No peer verification2 => Active Peer verification(4) => 2+4 = 6 => Force termination, if no client certificate(8) => 2+8=10 or 2+4+8 = 14 => Request client certificate only whithin initial handshakeciCertInfoREFERENCE TO CERT_INFO
A string to select the correct certificate in local certificate store
itfCertVeriferA callback for application specific cerificate verification
Methods:
SetInitialValue
Structure: