getdns Functions
PHP Manual


(PECL getdns >= 0.10.0)

php_getdns_context_set_tls_authenticationSet the TLS server authentication mode.


int php_getdns_context_set_tls_authentication ( int $context , int $value )

This function can be used to set the mode for upstream server hostname authentication for TLS connections in stub mode. The stub resolver can require that a server provide a valid certificate (validated using the default CA repository) and that the hostname specified in the "tls_auth_name" field of the upstream dictionary matches the name in the certificate. The authentication setting is only enforced when the transport list contains only GETDNS_TRANSPORT_TLS, and in this case if authentication fails for all upstreams, queries will fail. If the transport list contains other clear text transports then opportunistic TLS will be performed which does not require authentication of the TLS connection.



The previously created DNS context that is to be used with this request.


The value to be set. It must be either GETDNS_AUTHENTICATION_NONE (the default) or GETDNS_AUTHENTICATION_HOSTNAME to request host name validation.

Return Values

This function returns an integer response code. GETDNS_RETURN_GOOD indicates successful completion.

getdns Functions
PHP Manual