---
name: "TSSslServerContextCreate"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSSslServerContextCreate"
---

# TSSslServerContextCreate(3ts)

traffic Server TLS server context creation

## NAME

TSSslServerContextCreate - traffic Server TLS server context creation

## SYNOPSIS

```
#include <ts/ts.h>
```

- ***TSSslContext* TSSslServerContextCreate(*TSSslX509* \*cert, char \*certname)**

  - **void TSSslContextDestroy(*TSSslContext* ctx)**

  ## DESCRIPTION

*TSSslServerContextCreate()* creates a new TLS server context. The context is configured using the TLS settings specified in *records.config*. The user can pass certificate object(*TSSslX509* *cert* and certname (**const char\*** *certname*) optionally. This function sets the certificate status callback and initializes OCSP stapling data if *cert* and *certname* is provided and ocsp is enabled globally. *TSSslServerContextCreate()* returns **nullptr** on failure.

*TSSslContextDestroy()* destroys a TLS context created by *TSSslServerContextCreate()*. If *ctx* is **nullptr** no operation is performed.

## TYPE

- **type TSSslContext**

  The SSL context object. This is an opaque type that can be cast to the underlying SSL library type (**SSL\_CTX \*** for the OpenSSL library).

## SEE ALSO

**[TSAPI(3ts)](/TSAPI/3ts.md)**

## COPYRIGHT

2026, dev@trafficserver.apache.org
