Pagina 1 di 1

[RISOLTO] Problema con il certificato HTTPS

Pubblicato: 27 ottobre 2022 - 16:46
di Stenone
Buongiorno,
Quando configuro il server con un certificato esterno in nginx e lo ricarico (ricarica nginx), la pagina web viene visualizzata correttamente come HTTPS
Quindi ero felice.
Ora ricevo un errore quando provo a distribuire utilizzando waptdeploy.exe e l'hash e waptagent... c'è un errore durante il download di questo waptagent

Codice: Seleziona tutto

C:\Users\wapttestuser\Downloads>waptdeploy.exe --hash=02dfba835e17c928933a9bf929200cd50475fc8658322e1f4484b563bfe0738a --minversion=2.2.3.12463 --wait=15 --waptsetupurl=https://waptserver/wapt/waptagent.exe
{"hash":"02dfba835e17c928933a9bf929200cd50475fc8658322e1f4484b563bfe0738a","minversion":"2.2.3.12463","wait":"15","waptsetupurl":"https://waptserver/wapt/waptagent.exe"}
WAPT version:
WAPT required version: 2.2.3.12463
Wapt agent path: C:\Users\samuel.adm\AppData\Local\Temp\waptagent.exe
Wget new waptagent from https://waptserver/wapt/waptagent.exe
Trying to reach https://waptserver/wapt/waptagent.exe...
Expecting hash sha256: 02dfba835e17c928933a9bf929200cd50475fc8658322e1f4484b563bfe0738a
Using proxy :
Error trying to get https://waptserver/wapt/waptagent.exe : Error downloading https://waptserver/wapt/waptagent.exe: [ENetSock] THttpClientSocket.DoTlsAfter: TLS failed [ESChannel <waptserver>: Result 80090326 [SEC_E_ILLEGAL_MESSAGE], System Error 87 '']... sleeping
Delete sheduled task "fullwaptupgrade"
An unhandled exception occurred at $00403958:
Exception: Error downloading https://waptserver/wapt/waptagent.exe: [ENetSock] THttpClientSocket.DoTlsAfter: TLS failed [ESChannel <waptserver>: Result 80090326 [SEC_E_ILLEGAL_MESSAGE], System Error 87 '']
  $00403958
  $00404D73
Quando reinserisco il certificato autofirmato dall'installazione in nginx... funziona di nuovo, ma HTTPS non è conforme

PS: Ho provato a ricreare il mio pacchetto waptagent con un nuovo hash... ma non è quello il problema... so che è la mia configurazione
e infine https://waptserver/wapt/waptagent.exe è adeguatamente accessibile
Grazie in anticipo !
Samuel

Re: Problema con il certificato HTTPS

Pubblicato: 31 ottobre 2022 - 11:57
di sfontenau
Il problema riguarda solo waptdeploy?

Re: Problema con il certificato HTTPS

Pubblicato: 2 novembre 2022 - 09:50
di Stenone
A quanto pare è così...
Avevo configurato il GPO e l'avevo testato su una macchina, e funzionava... ma quando ho installato il certificato (valido per il nostro sito), il GPO ha smesso di funzionare, quindi ho provato a eseguire il comando manualmente, riscontrando gli errori menzionati nel post precedente. Ripristinando il vecchio certificato (autofirmato), il comando viene eseguito correttamente e l'agente viene distribuito sulla macchina di prova.

C'è un passaggio che ho saltato durante l'installazione/copia del mio certificato sul server Debian?

Alcuni dettagli: /etc/nginx/site-enabled/wapt.conf

Codice: Seleziona tutto

server {
    listen                      80;
    listen                      [::]:80;
    server_name                 _;
    return 301                  https://$host$request_uri;
}

server {
    listen                      443 ssl;
    listen                      [::]:443 ssl;
    server_name                 _;
    #server_name                 wapt.site.fr;
    # BACKUP certificat installation WAPT => autosigné
    #ssl_certificate             "/opt/wapt/waptserver/ssl/cert.pem";
    #ssl_certificate_key         "/opt/wapt/waptserver/ssl/key.pem";

    # Certificat site.fr => pour notre site ici
    ssl_certificate             "/opt/wapt/waptserver/ssl/cert+CA-site.fr.pem";
    ssl_certificate_key         "/opt/wapt/waptserver/ssl/wildcard-site.fr.pem";
    ssl_protocols               TLSv1.2;
    ssl_dhparam                 "/etc/ssl/certs/dhparam.pem";

    ssl_prefer_server_ciphers   on;
    ssl_ciphers                 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
    ssl_stapling                on;
    ssl_stapling_verify         on;
    ssl_session_cache           none;
    ssl_session_tickets         off;

    # HSTS (ngx_http_headers_module is required) (63072000 seconds)
    add_header Strict-Transport-Security "max-age=63072000" always;
    #ssl_client_certificate "/opt/wapt/conf/ca-wapt.site.fr.crt";
    #ssl_crl "None";
    #ssl_verify_client optional;
    gzip_min_length     1000;
    gzip_buffers        4 8k;
    gzip_http_version   1.0;
    gzip_disable        "msie6";
    gzip_types          text/plain text/css application/json;
    gzip_vary           on;

    index index.html;
    client_max_body_size 12288m;
    client_body_timeout 1800;

    # sub instances
    include /opt/wapt/conf/wapt.d/*.conf;

    location /static {
            alias "/opt/wapt/waptserver/static";
    }
    location /ssl {
            alias "/var/www/ssl";
    }
    # not protected URL
    location ~ ^/(wapt/waptsetup.*.exe|wapt/waptagent.exe|wapt/waptdeploy.exe|sync.json|rules.json|licences.json)$ {
        add_header Cache-Control "store, no-cache, must-revalidate, post-check=0, pre-check=0";
        add_header Pragma "no-cache";
        root "/var/www";
    }
    # not protected URL
    location /wads {
        alias "/var/www/wads";
    }
    # SSL protected URL
    location ~ ^/(wapt/.*|waptwua/.*|wapt-diff-repos/.*)$ {
        add_header Cache-Control "store, no-cache, must-revalidate, post-check=0, pre-check=0";
        add_header Pragma "no-cache";
        # be sure these headers are not forwarded
        proxy_set_header X-Ssl-Client-Dn  "";
        proxy_set_header X-Ssl-Authenticated  "";
        root "/var/www";
    }
    # we don't want to expose our list of computers in case someone scan this folder.
    location /wapt-host/Packages {
        return 403;
    }
    location ~ ^/(wapt-host/.*)$ {
        log_not_found off;
        add_header Cache-Control "store, no-cache, must-revalidate, post-check=0, pre-check=0";
        add_header Pragma "no-cache";
        proxy_set_header X-Ssl-Client-Dn  "";
        proxy_set_header X-Ssl-Authenticated  "";
        root "/var/www";
    }
    location ~ ^/.*_kerberos$ {
        return 403;
    }
    location / {
        add_header X-Remote-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_request_buffering off;
        proxy_set_header X-Forwarded-Proto $scheme;
        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_pass http://127.0.0.1:8080;
    }
    location /socket.io {
        proxy_http_version 1.1;
        proxy_request_buffering 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_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass http://127.0.0.1:8080/socket.io;
    }
}
 
GRAZIE MILLE!

Re: Problema con il certificato HTTPS

Pubblicato: 3 novembre 2022 - 16:28
di Stenone
Stiamo facendo qualche piccolo progresso...
Se modifico la mia chiamata waptdeploy in questo modo:

Codice: Seleziona tutto

waptdeploy.exe --hash=02dfba835e17c928933a9bf929200cd50475fc8658322e1f4484b563bfe0738a --minversion=2.2.3.12465 --wait=15 --waptsetupurl=https://wapt.monsite.fr/wapt/waptagent.exe
Ho l'errore precedente (TLS fallito)
se lo cambio con il suo indirizzo IP che funziona:

Codice: Seleziona tutto

waptdeploy.exe --hash=02dfba835e17c928933a9bf929200cd50475fc8658322e1f4484b563bfe0738a --minversion=2.2.3.12465 --wait=15 --waptsetupurl=https://[b]192.168.x.x[/b]/wapt/waptagent.exe
Ma le impostazioni DNS sul computer client sono OK... ping -a 192.168.xx e ping wapt.monsite.fr

Avete qualche idea?

Grazie mille

Re: Problema con il certificato HTTPS

Pubblicato: 8 novembre 2022 - 16:20
di dcardon
Ciao Stenon,

il problema più comune è che la catena di certificati è incompleta nel file /opt/wapt/waptserver/ssl/cert+CA-site.fr.pem. Verifica di avere i certificati intermedi.

Cordiali saluti,

Denis

Re: Problema con il certificato HTTPS

Pubblicato: 10 novembre 2022 - 09:59
di Stenone
Salve,

sì, sembra che il FQDN manchi dal mio certificato perché sto usando un certificato wildcard. Ho letto il post del 27 gennaio 2022 e l'errore è lo stesso.
Dato che devo usare il mio certificato wildcard, distribuirò l'agente tramite l'indirizzo IP nella mia GPO... e funziona correttamente.
Grazie per l'aiuto
Cordiali saluti,
Samuel

Re: Problema con il certificato HTTPS

Pubblicato: 10 novembre 2022 - 10:11
di dcardon
Ciao Samuel,

grazie per il tuo feedback. Ho aperto un ticket interno per questo problema. Nel frattempo, contrassegno la discussione come risolta.

Cordiali saluti,

Denis