# Functions

## `is_peer_verified()`

Returns true if the connection on which the message was received is TLS, the peer presented an X509 certificate and the certificate chain verified ok.

It can be used only in a request route.

### `is_peer_verified` usage

    ...
    	if (proto==TLS && !is_peer_verified()) {
    		sl_send_reply("400", "No certificate or verification failed");
    		exit;
    	}
    ...

## `tls_set_connect_server_id(srvid)`

Set the server id of the tls profile to be used by next client connect, being reset after use. It is an alternative to the use of xavp to specify server id of a client profile for the cases when xavps are no longer available (e.g., after event_route[tm:local-request]).

If the parameter is an empty string, then the value is reset.

It can be used only in ANY_ROUTE.

### `tls_set_connect_server_id` usage

    ...
        tls_set_connect_server_id("clientone");
    ...