↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Documentation / Extension Hooks / Authentication and connections

openssl_tls_init_hook

openssl_tls_init_hook

Call init hook (usually to set password callback)

Reading PostgreSQL 18.

Description

Call init hook (usually to set password callback)

Interface type
openssl_tls_init_hook_typ
Header
src/include/libpq/libpq-be.h
Subsystem
Authentication and connections
Initial value
default_openssl_tls_init

C interface

typedef void (*openssl_tls_init_hook_typ) (SSL_CTX *context, bool isServerStart);
extern PGDLLIMPORT openssl_tls_init_hook_typ openssl_tls_init_hook;

Call sites

src/backend/libpq/be-secure-openssl.c:132

Core call context: src/backend/libpq/be-secure-openssl.c:126–140

	 */
	SSL_CTX_set_mode(context, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);

	/*
	 * Call init hook (usually to set password callback)
	 */
	(*openssl_tls_init_hook) (context, isServerStart);

	/* used by the callback */
	ssl_is_server_start = isServerStart;

	/*
	 * Load and verify server's certificate and private key
	 */
	if (SSL_CTX_use_certificate_chain_file(context, ssl_cert_file) != 1)

Documentation and source

Source build
Version
18
Build
REL_18_STABLE
Source fingerprint
753057e340da8f22e57c9a409ea7a235fd6a46bd

Related entries

Back to Extension Hooks · Recorded in PostgreSQL 13 through 20; the first sample is not necessarily its introduction.