Socket.SSL.SetMethod
--------------------

Sets the SSL method for this socket.

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

MBS( "Socket.SSL.SetMethod"; SocketID; Method ) 

**MBS**( **"Socket.SSL.SetMethod";** /\* Sets the SSL method for this socket. \*/  
**$SocketID**; /\* The socket ID received by [Socket.Connect](SocketConnect.md) function.e.g. $sock \*/   
**$Method**) /\* The new SSL method. Can be SSLv2, SSLv3, SSLv23, TLSv1.0, TLSv1.1, TLSv1.2 or DTLSv1.0.e.g. "SSLv2" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| SocketID | The socket ID received by [Socket.Connect](SocketConnect.md) function. | $sock |
| Method | The new SSL method. Can be SSLv2, SSLv3, SSLv23, TLSv1.0, TLSv1.1, TLSv1.2 or DTLSv1.0. | "SSLv2" |

### Result

Returns OK or error.

### Description

Sets the SSL method for this socket.  
You first need to call [Socket.SSL.Prepare](SocketSSLPrepare.md) to init SSL to the step where you can set method.  
### See also

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

This function checks for a license.

Created 18th August 2014 , last changed 18th August 2014

  
[Socket.SSL.Prepare](SocketSSLPrepare.md) - [Socket.SSL.UseCertificateFile](SocketSSLUseCertificateFile.md)

[HTML Version](SocketSSLSetMethod.shtml)