---
name: "libressl-SSL_get_server_tmp_key"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-SSL_get_server_tmp_key"
---

# libressl-SSL\_get\_server\_tmp\_key(3)

temporary server key during a handshake

## NAME

**SSL\_get\_server\_tmp\_key** – temporary server key during a handshake

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

**#include \<openssl/ssl.h\>**

*long*\

**SSL\_get\_server\_tmp\_key**(*SSL \*ssl*, *EVP\_PKEY \*\*key*);

## DESCRIPTION

**SSL\_get\_server\_tmp\_key**() retrieves the temporary key provided by the server and used during key exchange. For example, if ECDHE is in use, this represents the server's public ECDHE key.

In case of success, a copy of the key is stored in \**key*. It is the caller's responsibility to free this key after use using EVP\_PKEY\_free(3).

This function may only be called by the client.

This function is implemented as a macro.

## RETURN VALUES

**SSL\_get\_server\_tmp\_key**() returns 1 on success or 0 on failure.

## SEE ALSO

EVP\_PKEY\_free(3), [ssl(3)](/ssl/3.md), SSL\_ctrl(3)

## HISTORY

**SSL\_get\_server\_tmp\_key**() first appeared in OpenSSL 1.0.2 and has been available since OpenBSD 6.1.
