1

I have a certain web app running on an Ubuntu 12.04 server that many clients are using over HTTP, not over HTTPS.

One client insisted on using HTTPS and he cannot download the PDF's generated by the web app.

The PDF files are created from an HTML template using wkHtmltopdf. The web server is Nginx

This is how my Nginx file looks like:

upstream cluster_my_client {
    server 127.0.0.1:8081;
    server 127.0.0.1:8082;
}

server {
    listen 443;
    ssl on;

    ssl_certificate /etc/nginx/ssl/CON_CA__intermediate_myclient.com.pem;
    ssl_certificate_key /etc/nginx/ssl/myclient.com.key;    

    gzip on;
    root /var/www/myclient;
    client_max_body_size 10M;

    if ($scheme = http) {
        rewrite ^ https://myclient.com/ permanent;
    }
    if ($server_port = 80) {
        rewrite ^ https://$host$request_uri permanent;
    }

    location / {
        try_files $uri @proxy;
    }

    # proxy for TG2
    location @proxy {
        proxy_pass          http://cluster_myclient;
        proxy_redirect      off;
        proxy_set_header    Host $host;
        proxy_set_header    X-Real-IP $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout  300;
        proxy_set_header X_FORWARDED_PROTO https;       
        proxy_set_header  X-Url-Scheme $scheme;
        proxy_redirect    off;
        proxy_max_temp_file_size 0;
    }
}
server{
    listen 80;
    server_name    myclient.com;
       return         301 https://$server_name$request_uri;
}

This is the error that appears in my app's log when trying to download a PDF file:

QSslSocket: cannot resolve SSLv2_client_method

Any idea on how to solve this?

Xar
  • 7,572
  • 19
  • 56
  • 80

2 Answers2

0

Could this be related to the bug in wkHtmlToPdf mentioned here?

Apparently there was a bug that gave the exact error message you see.

Community
  • 1
  • 1
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
0

I used the wicked_pdf-helpers to resolve this problem. Works fine https://github.com/mileszs/wicked_pdf#wicked_pdf-helpers

Abel
  • 3,989
  • 32
  • 31