furiousangelpt Posted January 4, 2025 at 03:35 PM Report #633944 Posted January 4, 2025 at 03:35 PM - Já refiz o certificado PFX com o e-mail da AT, visto que fiz com uma versão antiga do openssl - verifique a data de expiração, tanto o PFX como o publico: 28 junho 2025 - certificados instalados no computador, - o Windows 11 consigo comunicar para a google.com com TLS v1.2, por isso o SO permite a ligação, - a hora esta certa - o código tem a opção tls v1.2 ativo, tanto com ou sem o bypass - estou a utilizar o .net 4.8. Tenho o mesmo resultado: Using: 3072 <- app a utilizar tls v1.2 Certificate Thumbprint: C5052BD5...973EA18 <- certificado PFX Issuer: CN=DGITA Issuing CA2, DC=ritta, DC=local Expiration Date: 28/06/2025 15:03:33 ---------------------------- Pedido abortado: Não foi possível criar um canal seguro SSL/TLS. | Status: 10 sei que é fim de semana, e todos precisamos de descanso, mas há ideias do pq isto não funcionar? logo vou testar na versão .net 8 para ver se existe alguma limitação no .net 4.8 (pelo que li devia de suportar) Obrigado
marcolopes Posted January 4, 2025 at 03:50 PM Report #633945 Posted January 4, 2025 at 03:50 PM (edited) On 1/4/2025 at 3:35 PM, furiousangelpt said: - Já refiz o certificado PFX com o e-mail da AT, visto que fiz com uma versão antiga do openssl - verifique a data de expiração, tanto o PFX como o publico: 28 junho 2025 - certificados instalados no computador, - o Windows 11 consigo comunicar para a google.com com TLS v1.2, por isso o SO permite a ligação, - a hora esta certa - o código tem a opção tls v1.2 ativo, tanto com ou sem o bypass - estou a utilizar o .net 4.8. Tenho o mesmo resultado: Using: 3072 <- app a utilizar tls v1.2 Certificate Thumbprint: C5052BD5...973EA18 <- certificado PFX Issuer: CN=DGITA Issuing CA2, DC=ritta, DC=local Expiration Date: 28/06/2025 15:03:33 ---------------------------- Pedido abortado: Não foi possível criar um canal seguro SSL/TLS. | Status: 10 sei que é fim de semana, e todos precisamos de descanso, mas há ideias do pq isto não funcionar? logo vou testar na versão .net 8 para ver se existe alguma limitação no .net 4.8 (pelo que li devia de suportar) Obrigado CIFRAS suportadas pela implementação TLS que está a ser utilizada... https://www.portugal-a-programar.pt/forums/topic/57734-utilizar-webservices-da-at/page/633/#findComment-633920 Edited January 4, 2025 at 03:52 PM by marcolopes The simplest explanation is usually the correct one JAVA Utilities: https://github.com/marcolopes/dma
furiousangelpt Posted January 4, 2025 at 04:26 PM Report #633946 Posted January 4, 2025 at 04:26 PM On 1/4/2025 at 3:50 PM, marcolopes said: CIFRAS suportadas pela implementação TLS que está a ser utilizada... https://www.portugal-a-programar.pt/forums/topic/57734-utilizar-webservices-da-at/page/633/#findComment-633920 Pelos vistos nenhum, devo utilizar o SHA256withRSA? isso é na implementação?
Rui Carlos Posted January 4, 2025 at 04:34 PM Report #633947 Posted January 4, 2025 at 04:34 PM Em 04/01/2025 às 15:50, marcolopes disse: CIFRAS suportadas pela implementação TLS que está a ser utilizada... https://www.portugal-a-programar.pt/forums/topic/57734-utilizar-webservices-da-at/page/633/#findComment-633920 Referes-te ao SHA256withRSA? Isso não é apenas o algoritmo do certificado? (Até porque nem menciona a session cipher.) Nuns testes que fiz com o OpenSSL a tentar ligar-se directamente ao servidor, parece-me que suporta as seguintes cipher suites: ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-CHACHA20-POLY1305 Mesmo com estas, não consegui uma conexão bem sucedida, mas pareceu-me que pelo menos acordaram na cipher suite. EDIT: Para comparação, no porto 401, as seguintes cipher suites parecem ser suportadas: ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-SHA384 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA ECDHE-RSA-AES128-SHA (Mais algumas sem o ECDHE-RSA) Rui Carlos Gonçalves
marcolopes Posted January 4, 2025 at 07:14 PM Report #633948 Posted January 4, 2025 at 07:14 PM (edited) On 1/4/2025 at 4:34 PM, Rui Carlos said: Referes-te ao SHA256withRSA? Isso não é apenas o algoritmo do certificado? (Até porque nem menciona a session cipher.) Nuns testes que fiz com o OpenSSL a tentar ligar-se directamente ao servidor, parece-me que suporta as seguintes cipher suites: ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-CHACHA20-POLY1305 Mesmo com estas, não consegui uma conexão bem sucedida, mas pareceu-me que pelo menos acordaram na cipher suite. EDIT: Para comparação, no porto 401, as seguintes cipher suites parecem ser suportadas: ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-SHA384 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA ECDHE-RSA-AES128-SHA (Mais algumas sem o ECDHE-RSA) Nem mais! Por erro meu, indiquei no post que fiz a CIFRA do certificado. Queria indicar a cifra utilizada no handshake TLS A implementação do client TEM de suportar uma / a cifra exigida pela implementação da AT. No meu caso, por exemplo, se usar JAVA 7, a cifra da AT não está implementada do lado do client, e o estabelecimento da ligação falha. A solução foi passar para um client com a implementação requerida pela AT (neste caso, um provider TLS mais completo, que pode ser uma versão mais recente do Java, ou uma LIB externa com mais versatilidade, que acabou por ser a minha solução para não ser apanhado novamente por este problema...) Agora... estas alterações NÃO se fazem sem avisar os produtores de software!! Tanto mais que, quando colocada esta questão / problema à AT, nem fazem ideia do que estamos a falar, e atiram a culpa para as credenciais de autenticação!!! Edited January 4, 2025 at 07:20 PM by marcolopes The simplest explanation is usually the correct one JAVA Utilities: https://github.com/marcolopes/dma
furiousangelpt Posted January 4, 2025 at 11:45 PM Report #633949 Posted January 4, 2025 at 11:45 PM (edited) Já testei de tudo, alterei registries, configs, refiz o pfx, e mais uma data de coisas. ao executar da esta informação: -> Certificate Thumbprint: C5052BD59...XXXX..86DB1B6DD973EA18 -> Using: 3072 -> WebException: Pedido abortado: Não foi possível criar um canal seguro SSL/TLS. | Status: 10 Edited January 6, 2025 at 07:41 PM by furiousangelpt
abrito Posted January 4, 2025 at 11:48 PM Report #633950 Posted January 4, 2025 at 11:48 PM (edited) Cifras e versao tls suportadas por ordem de prioridade no endpoint Produção "servicos.portaldasfinancas.gov.pt:401/sgdtws/documentosTransporte" 1 ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 ECDH,P-384,384bits 2 ECDHE-RSA-AES256-SHA TLSv1,TLSv1.1,TLSv1.2 ECDH,P-384,384bits 3 ECDHE-RSA-AES256-SHA384 TLSv1.2 ECDH,P-384,384bits 4 AES256-GCM-SHA384 TLSv1.2 None 5 AES256-SHA TLSv1,TLSv1.1,TLSv1.2 None 6 AES256-SHA256 TLSv1.2 None 7 ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 ECDH,P-384,384bits 8 ECDHE-RSA-AES128-SHA TLSv1,TLSv1.1,TLSv1.2 ECDH,P-384,384bits 9 ECDHE-RSA-AES128-SHA256 TLSv1.2 ECDH,P-384,384bits 10 AES128-GCM-SHA256 TLSv1.2 None 11 AES128-SHA TLSv1,TLSv1.1,TLSv1.2 None 12 AES128-SHA256 TLSv1.2 None 13 EDH-RSA-DES-CBC-SHA TLSv1.2 DH,2048bits 14 DES-CBC-SHA TLSv1,TLSv1.1 None Certificate: Not a match, trusted, 2048 bit, sha256WithRSAEncryption signature TLS ticket lifetime hint: None OCSP stapling: not supported WARNING - None of the CNs match the hostname given Here is the list of common names found in the certificate *.portaldasfinancas.gov.pt,portaldasfinancas.gov.pt Cifras e versao tls suportadas por ordem de prioridade no endpoint Testes "servicos.portaldasfinancas.gov.pt:701/sgdtws/documentosTransporte" prio ciphersuite protocols pfs_keysize 1 ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 ECDH,P-256,256bits 2 ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 ECDH,P-256,256bits Certificate: Not a match, trusted, 2048 bit, sha256WithRSAEncryption signature TLS ticket lifetime hint: None OCSP stapling: not supported WARNING - None of the CNs match the hostname given Here is the list of common names found in the certificate *.portaldasfinancas.gov.pt,portaldasfinancas.gov.pt So estou a estranhar é eles nao suportarem tls V1.3 Edited January 4, 2025 at 11:58 PM by abrito
marcolopes Posted January 5, 2025 at 01:08 AM Report #633951 Posted January 5, 2025 at 01:08 AM Em 04/01/2025 às 23:48, abrito disse: So estou a estranhar é eles nao suportarem tls V1.3 TLS 1.3 está desligado no endpoint de TESTES É interessante ver que apenas DUAS CIFRAS suportadas pelo endpoint de TESTES são suportadas no ENDPOINT de produção! Preferred TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-256 DHE 256 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-GCM-SHA384 Curve P-256 DHE 256 Muito estranho. TODAS as cifras suportadas pelo endpoint de TESTES deveriam estar disponíveis no endpoint de PRODUÇÃO! Eu assumo que o que funciona no endpoint de TESTES funciona no endpoint de PRODUÇÃO! Aparentemente assumo erradamente! 😕 Anyway, eu continuo a dizer que a questão está relacionada com as CIFRAS de HANDSHAKE TLS 1.2 (1.1 ainda é suportado, mas eu aconselho a não usar porque a qualquer momento será removido pela AT) Os meus resultados são estes... TESTE sslscan https://servicos.portaldasfinancas.gov.pt:701/sgdtws/documentosTransporte Version: 2.1.5 Windows 64-bit (Mingw) OpenSSL 3.0.14 4 Jun 2024 Connected to 62.28.254.207 Testing SSL server servicos.portaldasfinancas.gov.pt on port 701 using SNI name servicos.portaldasfinancas.gov.pt SSL/TLS Protocols: SSLv2 disabled SSLv3 disabled TLSv1.0 disabled TLSv1.1 disabled TLSv1.2 enabled TLSv1.3 enabled TLS Fallback SCSV: Server supports TLS Fallback SCSV TLS renegotiation: Session renegotiation not supported TLS Compression: Compression disabled Heartbleed: TLSv1.3 not vulnerable to heartbleed TLSv1.2 not vulnerable to heartbleed Supported Server Cipher(s): Preferred TLSv1.3 128 bits TLS_AES_128_GCM_SHA256 Curve 25519 DHE 253 Accepted TLSv1.3 256 bits TLS_AES_256_GCM_SHA384 Curve 25519 DHE 253 Accepted TLSv1.3 256 bits TLS_CHACHA20_POLY1305_SHA256 Curve 25519 DHE 253 Preferred TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-256 DHE 256 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-GCM-SHA384 Curve P-256 DHE 256 Accepted TLSv1.2 256 bits ECDHE-RSA-CHACHA20-POLY1305 Curve P-256 DHE 256 Server Key Exchange Group(s): TLSv1.3 128 bits secp256r1 (NIST P-256) TLSv1.3 192 bits secp384r1 (NIST P-384) TLSv1.3 128 bits x25519 TLSv1.3 112 bits ffdhe2048 TLSv1.3 128 bits ffdhe3072 TLSv1.3 150 bits ffdhe4096 TLSv1.2 128 bits secp256r1 (NIST P-256) TLSv1.2 192 bits secp384r1 (NIST P-384) TLSv1.2 128 bits x25519 SSL Certificate: Signature Algorithm: sha256WithRSAEncryption RSA Key Strength: 2048 Subject: *.portaldasfinancas.gov.pt Altnames: DNS:*.portaldasfinancas.gov.pt, DNS:portaldasfinancas.gov.pt Issuer: Sectigo RSA Organization Validation Secure Server CA Not valid before: Oct 16 00:00:00 2024 GMT Not valid after: Nov 15 23:59:59 2025 GMT PRODUÇÃO sslscan https://servicos.portaldasfinancas.gov.pt:401/sgdtws/documentosTransporte Version: 2.1.5 Windows 64-bit (Mingw) OpenSSL 3.0.14 4 Jun 2024 Connected to 62.28.254.207 Testing SSL server servicos.portaldasfinancas.gov.pt on port 401 using SNI name servicos.portaldasfinancas.gov.pt SSL/TLS Protocols: SSLv2 disabled SSLv3 disabled TLSv1.0 enabled TLSv1.1 enabled TLSv1.2 enabled TLSv1.3 disabled TLS Fallback SCSV: Connection failed - unable to determine TLS Fallback SCSV support TLS renegotiation: Session renegotiation not supported TLS Compression: Compression disabled Heartbleed: TLSv1.2 not vulnerable to heartbleed TLSv1.1 not vulnerable to heartbleed TLSv1.0 not vulnerable to heartbleed Supported Server Cipher(s): Preferred TLSv1.2 256 bits ECDHE-RSA-AES256-GCM-SHA384 Curve P-384 DHE 384 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-SHA Curve P-384 DHE 384 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-SHA384 Curve P-384 DHE 384 Accepted TLSv1.2 256 bits AES256-GCM-SHA384 Accepted TLSv1.2 256 bits AES256-CCM Accepted TLSv1.2 256 bits AES256-CCM8 Accepted TLSv1.2 256 bits AES256-SHA Accepted TLSv1.2 256 bits AES256-SHA256 Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-384 DHE 384 Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-SHA Curve P-384 DHE 384 Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-SHA256 Curve P-384 DHE 384 Accepted TLSv1.2 128 bits AES128-GCM-SHA256 Accepted TLSv1.2 128 bits AES128-CCM Accepted TLSv1.2 128 bits AES128-CCM8 Accepted TLSv1.2 128 bits AES128-SHA Accepted TLSv1.2 128 bits AES128-SHA256 Accepted TLSv1.2 56 bits TLS_DHE_RSA_WITH_DES_CBC_SHA Preferred TLSv1.1 256 bits ECDHE-RSA-AES256-SHA Curve P-384 DHE 384 Accepted TLSv1.1 256 bits AES256-SHA Accepted TLSv1.1 128 bits ECDHE-RSA-AES128-SHA Curve P-384 DHE 384 Accepted TLSv1.1 128 bits AES128-SHA Accepted TLSv1.1 56 bits TLS_RSA_WITH_DES_CBC_SHA Accepted TLSv1.1 56 bits TLS_DHE_RSA_WITH_DES_CBC_SHA Preferred TLSv1.0 256 bits ECDHE-RSA-AES256-SHA Curve P-384 DHE 384 Accepted TLSv1.0 256 bits AES256-SHA Accepted TLSv1.0 128 bits ECDHE-RSA-AES128-SHA Curve P-384 DHE 384 Accepted TLSv1.0 128 bits AES128-SHA Accepted TLSv1.0 56 bits TLS_RSA_WITH_DES_CBC_SHA Accepted TLSv1.0 56 bits TLS_DHE_RSA_WITH_DES_CBC_SHA Server Key Exchange Group(s): TLSv1.2 128 bits secp256r1 (NIST P-256) TLSv1.2 192 bits secp384r1 (NIST P-384) TLSv1.2 128 bits x25519 SSL Certificate: Signature Algorithm: sha256WithRSAEncryption RSA Key Strength: 2048 Subject: *.portaldasfinancas.gov.pt Altnames: DNS:*.portaldasfinancas.gov.pt, DNS:portaldasfinancas.gov.pt Issuer: DigiCert Global G2 TLS RSA SHA256 2020 CA1 Not valid before: Jul 30 00:00:00 2024 GMT Not valid after: Feb 14 23:59:59 2025 GMT Com a "carrada" de CIFRAS suportadas no endpoint de PRODUÇÃO, eu acho que quem está a ter problemas nos endpoints de TESTE provavelmente não os terá nos endpoints de produção! Ainda assim há por aqui uma grande salgalhada do lado da AT! Com este cenário, nada garante que a implementação que passa nos endpoints de TESTE passem nos endpoints de PRODUÇÃO! 😕 The simplest explanation is usually the correct one JAVA Utilities: https://github.com/marcolopes/dma
furiousangelpt Posted January 5, 2025 at 11:15 AM Report #633952 Posted January 5, 2025 at 11:15 AM Existe algum comando especifico para fazer o Cert. PFX ou o Cert. Publico? Esta certo, falta alguma opção? Estou a utilizar o seguinte, PFX (a resposta do e-mail enviado pela AT): openssl pkcs12 -export -in NIF.crt -inkey NIF.key -out NIF.pfx E-mail recebido recentemente (Chave Publica): - openssl pkcs7 -inform der -in portaldasfinancas.gov.pt.p7b -out portaldasfinancas.gov.pt.pem - openssl pkcs7 -print_certs -in portaldasfinancas.gov.pt.pem -out portaldasfinancas.gov.pt.2025.cer
furiousangelpt Posted January 5, 2025 at 12:39 PM Report #633953 Posted January 5, 2025 at 12:39 PM Consegui arranjar o TesteWebservices.pfx do site da AT, pelos vistos já esta direito. Consegui comunicar com o serviço mas, reparei numa coisa o "Key Size" é 4096 isso faz diferença na comunicação? é que o meu PFX da empresa esta a 2048. Certificate Key Size: 4096 bits Certificate Signature Algorithm: sha256RSA Certificate Thumbprint: 6CB63B23C433DAE9A47220AD8C9E078664DED4B7 Certificate Subject: CN=TesteWebservices, OU=Sistemas de Informacao, O=Autoridade Tributaria e Aduaneira, L=Lisboa, S=Lisboa, C=PT Using: 3072 WebException: <?xml version='1.0' ?> <env:Envelope xmlns:env='http://www.w3.org/2003/05/soap-envelope'> <env:Body> <env:Fault> <env:Code> <env:Value>env:Receiver</env:Value> </env:Code> <env:Reason> <env:Text xml:lang="en-US">Internal Error (from server)</env:Text> </env:Reason> </env:Fault> </env:Body> </env:Envelope>
Rui Carlos Posted January 5, 2025 at 01:29 PM Report #633954 Posted January 5, 2025 at 01:29 PM O tamanho da chave e as cifras suportadas no ambiente de testes dão a ideia que a AT está a testar configurações mais seguras no ambiente de testes (que provavelmente serão migradas para o ambiente de produção). Rui Carlos Gonçalves
fakada Posted January 5, 2025 at 02:18 PM Report #633955 Posted January 5, 2025 at 02:18 PM Em 05/01/2025 às 12:39, furiousangelpt disse: Consegui arranjar o TesteWebservices.pfx do site da AT, pelos vistos já esta direito. Consegui comunicar com o serviço mas, reparei numa coisa o "Key Size" é 4096 isso faz diferença na comunicação? é que o meu PFX da empresa esta a 2048. Certificate Key Size: 4096 bits Certificate Signature Algorithm: sha256RSA Certificate Thumbprint: 6CB63B23C433DAE9A47220AD8C9E078664DED4B7 Certificate Subject: CN=TesteWebservices, OU=Sistemas de Informacao, O=Autoridade Tributaria e Aduaneira, L=Lisboa, S=Lisboa, C=PT Using: 3072 WebException: <?xml version='1.0' ?> <env:Envelope xmlns:env='http://www.w3.org/2003/05/soap-envelope'> <env:Body> <env:Fault> <env:Code> <env:Value>env:Receiver</env:Value> </env:Code> <env:Reason> <env:Text xml:lang="en-US">Internal Error (from server)</env:Text> </env:Reason> </env:Fault> </env:Body> </env:Envelope> Eu fiz o download do site da AT na semana passada e nao estou a conseguir testar guias de transporte. Alguem sabe se é necessario obter tambem a cadeia de certificados de raiz ? Ou seja os certificados das CAs usadas? Fabio
fakada Posted January 5, 2025 at 02:20 PM Report #633956 Posted January 5, 2025 at 02:20 PM Em 05/01/2025 às 01:08, marcolopes disse: TLS 1.3 está desligado no endpoint de TESTES É interessante ver que apenas DUAS CIFRAS suportadas pelo endpoint de TESTES são suportadas no ENDPOINT de produção! Preferred TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-256 DHE 256 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-GCM-SHA384 Curve P-256 DHE 256 Muito estranho. TODAS as cifras suportadas pelo endpoint de TESTES deveriam estar disponíveis no endpoint de PRODUÇÃO! Eu assumo que o que funciona no endpoint de TESTES funciona no endpoint de PRODUÇÃO! Aparentemente assumo erradamente! 😕 Anyway, eu continuo a dizer que a questão está relacionada com as CIFRAS de HANDSHAKE TLS 1.2 (1.1 ainda é suportado, mas eu aconselho a não usar porque a qualquer momento será removido pela AT) Os meus resultados são estes... TESTE sslscan https://servicos.portaldasfinancas.gov.pt:701/sgdtws/documentosTransporte Version: 2.1.5 Windows 64-bit (Mingw) OpenSSL 3.0.14 4 Jun 2024 Connected to 62.28.254.207 Testing SSL server servicos.portaldasfinancas.gov.pt on port 701 using SNI name servicos.portaldasfinancas.gov.pt SSL/TLS Protocols: SSLv2 disabled SSLv3 disabled TLSv1.0 disabled TLSv1.1 disabled TLSv1.2 enabled TLSv1.3 enabled TLS Fallback SCSV: Server supports TLS Fallback SCSV TLS renegotiation: Session renegotiation not supported TLS Compression: Compression disabled Heartbleed: TLSv1.3 not vulnerable to heartbleed TLSv1.2 not vulnerable to heartbleed Supported Server Cipher(s): Preferred TLSv1.3 128 bits TLS_AES_128_GCM_SHA256 Curve 25519 DHE 253 Accepted TLSv1.3 256 bits TLS_AES_256_GCM_SHA384 Curve 25519 DHE 253 Accepted TLSv1.3 256 bits TLS_CHACHA20_POLY1305_SHA256 Curve 25519 DHE 253 Preferred TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-256 DHE 256 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-GCM-SHA384 Curve P-256 DHE 256 Accepted TLSv1.2 256 bits ECDHE-RSA-CHACHA20-POLY1305 Curve P-256 DHE 256 Server Key Exchange Group(s): TLSv1.3 128 bits secp256r1 (NIST P-256) TLSv1.3 192 bits secp384r1 (NIST P-384) TLSv1.3 128 bits x25519 TLSv1.3 112 bits ffdhe2048 TLSv1.3 128 bits ffdhe3072 TLSv1.3 150 bits ffdhe4096 TLSv1.2 128 bits secp256r1 (NIST P-256) TLSv1.2 192 bits secp384r1 (NIST P-384) TLSv1.2 128 bits x25519 SSL Certificate: Signature Algorithm: sha256WithRSAEncryption RSA Key Strength: 2048 Subject: *.portaldasfinancas.gov.pt Altnames: DNS:*.portaldasfinancas.gov.pt, DNS:portaldasfinancas.gov.pt Issuer: Sectigo RSA Organization Validation Secure Server CA Not valid before: Oct 16 00:00:00 2024 GMT Not valid after: Nov 15 23:59:59 2025 GMT PRODUÇÃO sslscan https://servicos.portaldasfinancas.gov.pt:401/sgdtws/documentosTransporte Version: 2.1.5 Windows 64-bit (Mingw) OpenSSL 3.0.14 4 Jun 2024 Connected to 62.28.254.207 Testing SSL server servicos.portaldasfinancas.gov.pt on port 401 using SNI name servicos.portaldasfinancas.gov.pt SSL/TLS Protocols: SSLv2 disabled SSLv3 disabled TLSv1.0 enabled TLSv1.1 enabled TLSv1.2 enabled TLSv1.3 disabled TLS Fallback SCSV: Connection failed - unable to determine TLS Fallback SCSV support TLS renegotiation: Session renegotiation not supported TLS Compression: Compression disabled Heartbleed: TLSv1.2 not vulnerable to heartbleed TLSv1.1 not vulnerable to heartbleed TLSv1.0 not vulnerable to heartbleed Supported Server Cipher(s): Preferred TLSv1.2 256 bits ECDHE-RSA-AES256-GCM-SHA384 Curve P-384 DHE 384 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-SHA Curve P-384 DHE 384 Accepted TLSv1.2 256 bits ECDHE-RSA-AES256-SHA384 Curve P-384 DHE 384 Accepted TLSv1.2 256 bits AES256-GCM-SHA384 Accepted TLSv1.2 256 bits AES256-CCM Accepted TLSv1.2 256 bits AES256-CCM8 Accepted TLSv1.2 256 bits AES256-SHA Accepted TLSv1.2 256 bits AES256-SHA256 Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-384 DHE 384 Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-SHA Curve P-384 DHE 384 Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-SHA256 Curve P-384 DHE 384 Accepted TLSv1.2 128 bits AES128-GCM-SHA256 Accepted TLSv1.2 128 bits AES128-CCM Accepted TLSv1.2 128 bits AES128-CCM8 Accepted TLSv1.2 128 bits AES128-SHA Accepted TLSv1.2 128 bits AES128-SHA256 Accepted TLSv1.2 56 bits TLS_DHE_RSA_WITH_DES_CBC_SHA Preferred TLSv1.1 256 bits ECDHE-RSA-AES256-SHA Curve P-384 DHE 384 Accepted TLSv1.1 256 bits AES256-SHA Accepted TLSv1.1 128 bits ECDHE-RSA-AES128-SHA Curve P-384 DHE 384 Accepted TLSv1.1 128 bits AES128-SHA Accepted TLSv1.1 56 bits TLS_RSA_WITH_DES_CBC_SHA Accepted TLSv1.1 56 bits TLS_DHE_RSA_WITH_DES_CBC_SHA Preferred TLSv1.0 256 bits ECDHE-RSA-AES256-SHA Curve P-384 DHE 384 Accepted TLSv1.0 256 bits AES256-SHA Accepted TLSv1.0 128 bits ECDHE-RSA-AES128-SHA Curve P-384 DHE 384 Accepted TLSv1.0 128 bits AES128-SHA Accepted TLSv1.0 56 bits TLS_RSA_WITH_DES_CBC_SHA Accepted TLSv1.0 56 bits TLS_DHE_RSA_WITH_DES_CBC_SHA Server Key Exchange Group(s): TLSv1.2 128 bits secp256r1 (NIST P-256) TLSv1.2 192 bits secp384r1 (NIST P-384) TLSv1.2 128 bits x25519 SSL Certificate: Signature Algorithm: sha256WithRSAEncryption RSA Key Strength: 2048 Subject: *.portaldasfinancas.gov.pt Altnames: DNS:*.portaldasfinancas.gov.pt, DNS:portaldasfinancas.gov.pt Issuer: DigiCert Global G2 TLS RSA SHA256 2020 CA1 Not valid before: Jul 30 00:00:00 2024 GMT Not valid after: Feb 14 23:59:59 2025 GMT Com a "carrada" de CIFRAS suportadas no endpoint de PRODUÇÃO, eu acho que quem está a ter problemas nos endpoints de TESTE provavelmente não os terá nos endpoints de produção! Ainda assim há por aqui uma grande salgalhada do lado da AT! Com este cenário, nada garante que a implementação que passa nos endpoints de TESTE passem nos endpoints de PRODUÇÃO! 😕 Verdade... em produçao consigo comunicar... no endpoint de testes nao consigo.
marcolopes Posted January 5, 2025 at 02:46 PM Report #633957 Posted January 5, 2025 at 02:46 PM On 1/5/2025 at 2:20 PM, fakada said: Verdade... em produçao consigo comunicar... no endpoint de testes nao consigo. Bingo! Expliquei as razões no meu ultimo post... The simplest explanation is usually the correct one JAVA Utilities: https://github.com/marcolopes/dma
trs80 Posted January 5, 2025 at 03:22 PM Report #633958 Posted January 5, 2025 at 03:22 PM Boas, No inicio da comunicação de DTs eu usei a applet da AT como base. Nunca consegui por a funcionar em Java8 com TLS1.2 por isso mantive java7 com TLS. Aparentemente agora vai deixar de funcionar (com o ultimo Testewebservices.pfx) tenho o erro "DER input not an octet string" Isto acontece tanto com TLS, TLSV1.2, java 7 ou java 8 Alguem tem conhecimento de alguma versao actualizada da Applet ? Obrigado
fakada Posted January 5, 2025 at 03:26 PM Report #633959 Posted January 5, 2025 at 03:26 PM Em 05/01/2025 às 13:29, Rui Carlos disse: O tamanho da chave e as cifras suportadas no ambiente de testes dão a ideia que a AT está a testar configurações mais seguras no ambiente de testes (que provavelmente serão migradas para o ambiente de produção). Mas pelo menos a cifra comum que é aceite pelos 2 ambientes (TLSv1.2 enabled) devia ser aceite tanto em prod como em testes nao ?
trs80 Posted January 5, 2025 at 04:18 PM Report #633960 Posted January 5, 2025 at 04:18 PM On 1/5/2025 at 3:26 PM, fakada said: Mas pelo menos a cifra comum que é aceite pelos 2 ambientes (TLSv1.2 enabled) devia ser aceite tanto em prod como em testes nao ? Penso que só amanhã o ambiente de producao ira funcionar....
trs80 Posted January 5, 2025 at 04:25 PM Report #633961 Posted January 5, 2025 at 04:25 PM Alguem conseguiu com Java 8 usar o ultimo Testewebservices ? O problema que tenho é logo no load do Testewebservices.pfx, com java7 tenho "DER input not an octet string" com java 8 "ObjectIdentifier() -- data isn't an object ID (tag = 48) Segundo https://stackoverflow.com/questions/70576089/caused-by-java-io-ioexception-objectidentifier-data-isnt-an-object-id-t Aparentemente os algoritmos usados nos novos certificados de teste exigem java 11+
furiousangelpt Posted January 5, 2025 at 04:32 PM Report #633962 Posted January 5, 2025 at 04:32 PM o utilizador de testes esta a funcionar? User = "599999993/0037" Pass = "TESTE" <faultcode>33</faultcode> <faultstring>Ocorreu um erro na autenticacao dos contribuintes.</faultstring> <faultactor/>
Rui Carlos Posted January 5, 2025 at 04:52 PM Report #633963 Posted January 5, 2025 at 04:52 PM Em 05/01/2025 às 15:26, fakada disse: Mas pelo menos a cifra comum que é aceite pelos 2 ambientes (TLSv1.2 enabled) devia ser aceite tanto em prod como em testes nao ? As cifras ECDHE-RSA-AES256-GCM-SHA384 e ECDHE-RSA-AES128-GCM-SHA256 devem funcionar em ambos os ambientes. 1 Report Rui Carlos Gonçalves
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now