X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fconnection.c;h=26947ffdbfd60968e3c0b229b188161a2767ba8f;hb=d232e106feb871ff63736df76b708eb684d31b72;hp=7ea6eb24a7573dd14d5d21facf89a06dc2546c9d;hpb=8db64b0eebeaa80e46b2df40b91af741e533e7bc;p=tlsproxy%2Ftlsproxy.git diff --git a/src/connection.c b/src/connection.c index 7ea6eb2..26947ff 100644 --- a/src/connection.c +++ b/src/connection.c @@ -35,10 +35,6 @@ * should be a good limit to make processing simpler. */ #define MAX_REQUEST_LINE 4096 -/* Paths to necessary TLS files: the CA and the server key. */ -#define PROXY_CA_FILE "proxy-ca.pem" -#define PROXY_KEY_FILE "proxy-key.pem" - static int initialize_tls_session_client(int peer_socket, const char *hostname, @@ -284,12 +280,9 @@ static int initialize_tls_session_client(int peer_socket, gnutls_certificate_credentials_t *x509_cred) { int result; char path[1024]; - /* The server certificate for the given hostname is stored in - * "./certificate-hostname-proxy.pem". */ -#define PATH_FORMAT "./certificate-%s-proxy.pem" /* Hostname too long. */ - if (sizeof(path) - strlen(PATH_FORMAT) <= strlen(hostname)) { + if (sizeof(path) - strlen(PROXY_SERVER_CERT_FORMAT) <= strlen(hostname)) { LOG(LOG_WARNING, "initialize_tls_session_client(): hostname too long: '%s'", hostname); @@ -302,8 +295,7 @@ static int initialize_tls_session_client(int peer_socket, hostname); return -1; } - snprintf(path, sizeof(path), PATH_FORMAT, hostname); -#undef PATH_FORMAT + snprintf(path, sizeof(path), PROXY_SERVER_CERT_FORMAT, hostname); result = gnutls_certificate_allocate_credentials(x509_cred); if (GNUTLS_E_SUCCESS != result) {