ST_IotSocketTls
The following type contains the TLS security settings for the HTTP client and the WebSocket client.
Either CA (Certificate Authority) or PSK (PreSharedKey) can be used.
Syntax
Definition:
TYPE ST_IotSocketTls :
STRUCT
sCA : STRING(255*);
sCert : STRING(255*);
sKeyFile : STRING(255*);
sKeyPwd : STRING(255*);
sCrl : STRING(255*);
sCiphers : STRING(255*);
sVersion : STRING(80) := 'tlsv1.2';
bNoServerCertCheck : BOOL := FALSE;
sPskIdentity : STRING(255*);
aPskKey : ARRAY[1..64*] OF BYTE;
nPskKeyLen : USINT;
END_STRUCT
END_TYPE
Parameter
Name | Type | Description |
---|---|---|
sCA | STRING(255) | Certificate of the certificate authority (CA) |
sCert | STRING(255) | Client certificate for server authentication |
sKeyFile | STRING(255) | Private key of the client |
sKeyPwd | STRING(255) | Password of the private key, if applicable |
sCrl | STRING(255) | Path to the certificate revocation list, which may be present in PEM or DER format |
sCiphers | STRING(255) | Cipher suites to be used, specified in OpenSSL string format |
sVersion | STRING(80) | TLS version to be used |
bNoServerCertCheck | BOOL | Disables verification of the server certificate validity. If communication is to take place without TLS encryption (HTTP/WebSockets), this value must remain FALSE. |
sPskIdentity | STRING(255) | PreSharedKey identity for TLS PSK connection |
aPskKey | ARRAY[1..64] OF BYTE | PreSharedKey for TLS PSK connection |
nPskKeyLen | USINT | Length of the PreSharedKey in bytes |
All strings and arrays marked with an * are initialized with the value in brackets. These values can be accessed and changed via the parameter list. This is not possible at runtime, but only before the code is compiled.