|
|
|
|
|
- Recreating a socket
- Re-using an address that is already used
SocketCreateSSL (Function) In french: SocketCréeSSL Creates a secure socket according to the SSL protocol.
sSSLSocket is string = "sSSLSocket"
IF NOT SocketCreateSSL(sSSLSocket, 5043, "9d a4 84 fc f6 62 92 90 9a 62 d4 " + ...
"ca 65 fb 08 7e 06 45 of 24", CertificateHash) THEN
Error(ErrorInfo())
RETURN
ELSE
Info("SSL server socket started")
SocketClose(sSSLSocket)
END
Syntax
<Result> = SocketCreateSSL(<Socket name> , <Port number> , <Certificate Identifier> [, <SSL options> [, <Address>]])
<Result>: Boolean - True if the socket was created,
- False otherwise. If an error occurs, you can get more details on the error with ErrorInfo.
<Socket name>: Character string Name that will be given to the socket. This name will be used by all socket functions. Caution: the socket name is case sensitive. <Port number>: Integer Port number that will be given to the socket. This number must be included between 5000 and 65000. This number will be specified when the client computers are connected to the server. This connection will be established by SocketConnectSSL. <Certificate Identifier>: Character string Name or hash of the certificate to use (according to the specified <SSL Options>): - name of certificat if the CertificateName constant is used,
- hash of certificate if the CertificateHash constant is used. The space characters are allowed in the Hash. The hash of the certificate can be found in the "Digital Print" property in the certificate manager (certmgr.msc) of the computer, for example:
"9d a4 84 fc f6 62 92 90 9a 62 d4 ca 65 fb 08 7e 06 45 de 24"
<SSL options>: Optional combination of integer constants Protocol and identification mode used: | | ProtocolSSL2 | SSL2 protocol. | ProtocolSSL3 | SSL3 protocol. | ProtocolTLS1 | TLS1 protocol | ProtocolTLS1_1 | TLS 1.1 protocol | ProtocolTLS1_2 | TLS 1.2 protocol | ProtocolTLS1_3 | TLS 1.3 protocol |
| | CertificateHash | <Certificate identifier> corresponds to the hash of certificate. | CertificateName | <Certificate identifier> corresponds to the name of certificate. |
By default, the combination used is: ProtocolTLS1 + ProtocolTLS1_1 + ProtocolTLS1_2 + CertificateName. <Address>: Optional character string IP address on which the socket must be created on the current computer. If the current computer is associated with several IP addresses (or with several network cards), this parameter enables you to choose the IP address that will be associated with the socket.This IP address can have the following format: - IP address in XXX.XXX.XXX.XXX format (125.5.110.100 for example).
- IP address containing the name of the server (www.windev.com for example). This syntax is recommended.
Remarks Recreating a socket If a socket is not closed properly by SocketClose (restarting the computer for example), recreating the socket may take quite a long time. Indeed, you will have to wait until the socket is freed by the system. Re-using an address that is already used By default, SocketCreateSSL allows you to reuse an address already used (by the application itself or by another application). To forbid this operating mode, type the following line of code: Socket.Option = SocketNoReuseAddress
Remark: This option also indicates whether an address or port is already in use.. In this case, SocketCreateSSL returns an error.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|