Socket.SSL.UseCertificateFile
-----------------------------

Defines to use a certificate key file for this SSL 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.UseCertificateFile"; SocketID; Path; Type ) 

**MBS**( **"Socket.SSL.UseCertificateFile";** /\* Defines to use a certificate key file for this SSL socket. \*/  
**$SocketID**; /\* The socket ID received by [Socket.Connect](SocketConnect.md) function.e.g. $sock \*/   
**$Path**; /\* The path to the certificate file. \*/   
**$Type**) /\* The type of the file. Can be "PEM" or "ASN1".e.g. "PEM" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| SocketID | The socket ID received by [Socket.Connect](SocketConnect.md) function. | $sock |
| Path | The path to the certificate file. | $path |
| Type | The type of the file. Can be "PEM" or "ASN1". | "PEM" |

### Result

Returns OK on success or error.

### Description

Defines to use a certificate key file for this SSL socket.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### See also

- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [Socket.Connect](SocketConnect.md)

This function checks for a license.

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

  
[Socket.SSL.SetMethod](SocketSSLSetMethod.md) - [Socket.SSL.UsePrivateKeyFile](SocketSSLUsePrivateKeyFile.md)

[HTML Version](SocketSSLUseCertificateFile.shtml)