ssl_send_certificate_error(): Make it more obvious that the message is coming from...
[privoxy.git] / ssl.c
diff --git a/ssl.c b/ssl.c
index 852a9ce..3e2d8a5 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -1337,17 +1337,16 @@ static int generate_certificate_valid_date(time_t time_spec, char *buffer,
                                            size_t buffer_size)
 {
    struct tm valid_date;
+   struct tm *timeptr;
    size_t ret;
 
-#ifndef HAVE_GMTIME_R
-#error HTTP inspection currently requires gmtime_r() which seems to be missing
-#endif
-   if (NULL == gmtime_r(&time_spec, &valid_date))
+   timeptr = privoxy_gmtime_r(&time_spec, &valid_date);
+   if (NULL == timeptr)
    {
       return 1;
    }
 
-   ret = strftime(buffer, buffer_size, "%Y%m%d%H%M%S", &valid_date);
+   ret = strftime(buffer, buffer_size, "%Y%m%d%H%M%S", timeptr);
    if (ret != 14)
    {
       return 1;
@@ -2065,7 +2064,10 @@ extern void ssl_send_certificate_error(struct client_state *csp)
       "HTTP/1.1 200 OK\r\n"
       "Content-Type: text/html\r\n"
       "Connection: close\r\n\r\n"
-      "<html><body><h1>Server certificate verification failed</h1><p>Reason: ";
+      "<html><body><h1>Server certificate verification failed</h1>"
+      "<p><a href=\"https://" CGI_SITE_2_HOST "/\">Privoxy</a> was unable "
+      "to securely connnect to the destination server.</p>"
+      "<p>Reason: ";
    const char message_end[] = "</body></html>\r\n\r\n";
    char reason[INVALID_CERT_INFO_BUF_SIZE];
    memset(reason, 0, sizeof(reason));