---
title: "The SSL Transport"
url: https://docs.zeroc.com/ice/3.8/runtime/ssl-transport
language: python
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# The SSL Transport

Programming language: Python. Other languages: [C++](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport/java.md), [MATLAB](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport/php.md), [Ruby](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport/swift.md).

The SSL transport provides support for securing Ice connections using the SSL/TLS protocols. It is a built-in transport available on all supported platforms and in every language mapping except JavaScript, which secures its connections with the [WSS transport](https://docs.zeroc.com/ice/3.8/runtime/transports/python.md).

The SSL transport is built on top of each platform’s native SSL/TLS engine. This ensures interoperability with platform-provided features and that any security updates to the SSL/TLS engine also apply to your Ice applications.

## Using the SSL Transport

To use the SSL transport, you must configure `ssl` endpoints for your client and server applications.

Clients use the SSL transport by specifying a `ssl` endpoint when creating a proxy:

```py
greeter = VisitorCenter.GreeterPrx(
    communicator,
    "greeter:ssl -h localhost -p 4061");
```

Servers enable the SSL transport by using a `ssl` endpoint for their object adapter:

```py
adapter = communicator.createObjectAdapterWithEndpoints(
    "GreeterAdapter",
    "ssl -p 4061")
```

Both client and server must provide additional configuration to use the SSL transport. The configuration can be done using the SSL transport configuration properties, or programmatically using the platform specific APIs for the SSL transport.

At a minimum, you need to:

- Specify the server’s certificate and private key.
- Configure the trusted certificate authorities that the client uses to validate the server certificate.

Many additional options are available, but they are optional.

### Configure the SSL Transport Programmatically

The SSL transport configuration APIs provide access to more advanced features and to the underlying SSL engine. Because they rely on platform-native APIs, you can only use them with **C++**, **Java**, and **C#**, which provide their own SSL transport implementations. These APIs are not available in language mappings that reuse the C++ SSL transport (such as Python, PHP, Ruby, MATLAB, and Swift). For those, you must rely on the SSL transport configuration properties described below.

In C++, three SSL transport implementations are available:

- **OpenSSL** (Linux)
- **Secure Transport** (macOS)
- **Schannel** (Windows)

C# uses the SSL engine provided by .NET, and Java uses the SSL engine provided by the JDK.

In all cases, these APIs allow you to configure the SSL transport:

- **Per Object Adapter** for incoming connections.
- **Per Communicator** for outgoing connections.

These APIs address the following needs:

- Provide certificates and keys programmatically.
- Support hot certificate reload.
- Support custom certificate validation.
- Allow advanced configuration of the platform SSL engine.

### Configure the SSL Transport Using Properties

Sample server-side configuration showing how to set the server’s certificate and private key:

```config
# The server's certificate file.
IceSSL.CertFile=server.p12
IceSSL.Password=password

# Turn on security logging/tracing.
IceSSL.Trace.Security=1
```

Sample client-side configuration showing how to set the trusted root authorities for validating the server certificate:

```config
# The trusted certificate authorities used to validate peer certificates.
IceSSL.CAs=ca_cert.pem
```

For additional details refer to the [IceSSL properties](https://docs.zeroc.com/ice/3.8/property-reference/icessl-properties/python.md) documentation.

## SSL Connection Information

The SSL connection information of a connection describes its SSL session, in particular the certificate the peer presented. To get it, call `getInfo` on the connection and walk the `underlying` chain of the returned [connection information](https://docs.zeroc.com/ice/3.8/runtime/transports/python.md#endpoint-and-connection-information): for an `ssl` connection, `getInfo` returns the SSL connection information itself, and for a `wss` connection, it returns a `WSConnectionInfo` whose `underlying` field holds the SSL connection information.

## Endpoint Security Considerations

You should avoid creating object adapters that include both secure and non-secure endpoints. For example, having both TCP and SSL endpoints on the same object adapter defeats the purpose of using SSL, since clients could bypass the secure connection and access the adapter through the plain TCP endpoint.

For most applications that handle sensitive data or operate on untrusted networks (including the internet or intranets), the recommended practice is to use **only secure endpoints**.

## Using SSL with Other Transports

You can see the SSL transport as using the SSL/TLS protocol on top of Ice TCP transport, but it is possible to use SSL/TLS on top of other transports.

Ice supports the following secure transports:

| **Transport** | **Underlying Transport** |
| --- | --- |
| ssl | tcp |
| wss | ws |
| bts | bt |
| iaps | iap |

The configuration for the SSL/TLS protocol for these secure transports is the same as what was described above for the SSL transport.
