| 181 | } |
| 182 | |
| 183 | SSL* SSL_new_client() |
| 184 | { |
| 185 | SSL* ssl = SSL_new(sip_trp_ssl_ctx_client); |
| 186 | |
| 187 | // Inject the ServerNameIndication (SNI). |
| 188 | // It requires to be a hostname. However, SSL takes whatever we set. |
| 189 | // Ref https://datatracker.ietf.org/doc/html/rfc6066#section-3 |
| 190 | if (strcmp(remote_ip, remote_host)) { |
| 191 | SSL_set_tlsext_host_name(ssl, remote_host); |
| 192 | } |
| 193 | |
| 194 | return ssl; |
| 195 | } |
| 196 | |
| 197 | SSL* SSL_new_server() |
| 198 | { |
no outgoing calls
no test coverage detected