- /* Hostname too long. */
- if (sizeof(path) - strlen(PROXY_SERVER_CERT_FORMAT) <= strlen(hostname)) {
- LOG(LOG_WARNING,
- "initialize_tls_session_client(): hostname too long: '%s'",
- hostname);
- return -1;
- }
- /* Try to prevent path traversals in hostnames. */
- if (NULL != strstr(hostname, "..")) {
- LOG(LOG_WARNING,
- "initialize_tls_session_client(): possible path traversal: '%s'",
- hostname);
+ if (0 != proxy_certificate_path(hostname, path, sizeof(path))) {
+ LOG(LOG_ERROR,
+ "initialize_tls_session_client(): \
+failed to get proxy certificate path");