Socket.SSL.Initialize
---------------------

Initializes a SSL connection.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Socket](component_Socket.md) | [3.5](newinversion35.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Socket.SSL.Initialize"; SocketID ) 

**MBS**( **"Socket.SSL.Initialize";** /\* Initializes a SSL connection. \*/  
**$SocketID**) /\* The socket ID received by [Socket.Connect](SocketConnect.md) function.e.g. $sock \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| SocketID | The socket ID received by [Socket.Connect](SocketConnect.md) function. | $sock |

### Result

Returns OK or error.

### Description

Initializes a SSL connection.  
First you need to create TCP socket and accept or connect.  
Optionally you can call [Socket.SSL.Prepare](SocketSSLPrepare.md) first.  
After Socket.SSL.Initialize you can call [Socket.SSL.Connect](SocketSSLConnect.md) or [Socket.SSL.Accept](SocketSSLAccept.md).  
  
Instead of using this SSL socket, please consider letting CURL do the job: Use [CURL.SetOptionConnectOnly](CURLSetOptionConnectOnly.md) to let CURL connect and than send data using [CURL.SendData](CURLSendData.md) and [CURL.SendText](CURLSendText.md). For receiving, please use [CURL.ReceiveData](CURLReceiveData.md) and [CURL.ReceiveText](CURLReceiveText.md). This gives you much more SSL options and proxy support.  
### See also

- [CURL.ReceiveData](CURLReceiveData.md)
- [CURL.ReceiveText](CURLReceiveText.md)
- [CURL.SendData](CURLSendData.md)
- [CURL.SendText](CURLSendText.md)
- [CURL.SetOptionConnectOnly](CURLSetOptionConnectOnly.md)
- [Socket.Connect](SocketConnect.md)
- [Socket.SSL.Accept](SocketSSLAccept.md)
- [Socket.SSL.Connect](SocketSSLConnect.md)
- [Socket.SSL.Prepare](SocketSSLPrepare.md)

### Example Databases

- [Network/SSL/TCP Sender SSL](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Network/SSL/TCP%20Sender%20SSL.shtml#1ScriptAnchor_)
- [Network/SSL/TCP Socket SSL](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Network/SSL/TCP%20Socket%20SSL.shtml#1ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 10th April 2017

  
[Socket.SSL.GetMethod](SocketSSLGetMethod.md) - [Socket.SSL.Prepare](SocketSSLPrepare.md)

[HTML Version](SocketSSLInitialize.shtml)