5376 Commits

Author SHA1 Message Date
Dirk Wetter 51ba8327a8 introduce subfunctions decode_*
First implemented and tested working is decode_https_rr_alpn().
Also we use the svk params in a case statement to decipher the
hexstream better.

The hexstream ($line) has now no blanks anymore. They seem to be
arbitrary.

Variables need to be declared in get_https_rrecord() .
2026-06-02 19:04:17 +02:00
Dirk Wetter a92cd8f702 fix shellcheck complaint 2026-06-01 16:56:47 +02:00
Dirk Wetter 84bd9dd1a3 Updatesr get_https_rrecord()
- quote vars (hoping it'll resolve the Mac runner issue)
- make sure CNAMEs are properly parsed
- end get_https_rrecord() earlier when there's no record but DNS binaries are "HTTPS record aware"
- while loop was redundant
- better comments

Elsewhere:

make sure get_https_rrecord is called with a trailing dot for the NODE
2026-06-01 16:14:29 +02:00
Dirk Wetter ba7d9604a9 Getting from github runner under MacOS
as there is an inexplicable difference between a real Mac
which passes the run and the one in github

-"DNS_HTTPS_rrecord","testssl.sh/81.169.235.32","443","OK","81.169.235.32","",""
+"DNS_HTTPS_rrecord","testssl.sh/81.169.235.32","443","OK","1 . alpn='h2'","",""

The first line comes from the runner
2026-06-01 10:14:25 +02:00
Dirk Wetter e365ccf03f try to squash the baseline comparison check 2026-05-31 19:59:01 +02:00
Dirk Wetter e0c0a6658f Provide HTTPS RR functionality
This is a fresh start for #2484 as the PR wasn't ready yet for 3.2 by the time it was released. And it continues #2866
which was kind of messed up by accident.

The info for the HTTPS RR shows up in the very beginning, i.e. in `service_detection()`. All keys are listed now in bold, values in a regular font.

`get_https_rrecord()` was introduced by copying and modifying `get_caa_rr_record()`.

There's a similar obstacle as with CAA RRs: older binaries show the  resource records binary encoded. Thus a new set of global vars is introduced HAS_*_HTTPS which check whether the binaries support decoding the RR directly. As of now raw decoding doesn't work completely.

Todo:
- Add logic in QUIC
    - if RR is detected and not QUIC is possible
    - add time for QUIC detection when RR is retrieved
- show full HTTPS RR record, at least when having a new DNS client
- coninue with raw decoding, if possible (otherwise problematic for MacOS)
- shorten the comments in `get_https_rrecord()`
- man page
- when ASSUME_HTTP is set and no services was detected: this needs to be handled
- The placement of the output should be reconsidered and/or cached when multiple IPs belong to a FQDN
2026-05-30 17:40:34 +02:00
Dirk Wetter 316b1a8014 Merge pull request #3045 from testssl/add_fs_data_clientsimulation_json
Add fs data clientsimulation json
2026-05-29 16:07:24 +02:00
Dirk 209e76541e Using a compariable Linux distro in the firstplace for updating handshake would have been great ;-) 2026-05-29 15:20:17 +02:00
Dirk ec99148700 Fix html output runner 2026-05-29 13:00:58 +02:00
Dirk 1ee1a60a99 var name append_fileout is clearer 2026-05-29 10:53:28 +02:00
Dirk 566e1b1f65 Fix diff complaint raised by ./t/12_diff_opensslversions.t 2026-05-29 10:33:03 +02:00
Dirk cff2c0810c Add Linux, not Mac baseline ;-) 2026-05-28 20:41:00 +02:00
Dirk Wetter 01d58f5e9c update client simulation data 2026-05-28 19:07:28 +02:00
Dirk Wetter cf66ad61bd Add forward secrecy data to file output
This fixes #3040 .

Also this removes the debug lines within the if statement (bottom of run_client_simulation() ), probably
a historic leftover.
2026-05-28 19:03:39 +02:00
Dirk Wetter 9567e65a01 Merge pull request #3043 from testssl/issue_cmdline_warnings
Introduce early warning function
2026-05-28 13:31:27 +02:00
Dirk Wetter 75376d38bf Introduce early warning function
... which warns also via file output when not recommended command
line options are used.

This function named issue_cmdline_warnings() is being called in
lets roll after all fileout() functions has been initialized.
It needs to make use of fileout_insert_warning() though because
otherwise the JSON output is not correct.

Besides the previoulsy introduced warning when scanning IP addresses,
warnings of usage of '--fast' and '--ssl-native' will end up also
in a file now which gives ther tools using the machine readable
output to detect bad scan conditions.

Also warnings when scanning the most known IPv4 addresses
from Cloudflare, Google and Quad9, are avoided.
2026-05-28 10:37:16 +02:00
Dirk Wetter ca99b45f1f Merge pull request #3042 from testssl/grhza-3.3dev
Improve PR #3041
2026-05-27 18:16:42 +02:00
Dirk Wetter f8af511952 Improve PR #3041
* move message when scanning IP address to the very beginning, inside parse_cmd_line()
* improve message
* just check whether there are no chars a-zA-Z

* move [[ $caa_node =~ '.'$ ]] || caa_node+="." into the while loop
2026-05-27 16:53:06 +02:00
Raymond Huygen d4f1b31f0d Fix DNS CAA check for IP scans and subdomains
- Skip CAA lookup entirely when NODE is an IP address; show
  "not checked (IP address scan)" instead of spuriously querying
  IP octets as domain labels and reporting "not offered"
- Force FQDN (trailing dot) on the initial caa_node before the
  walk loop so dig does not apply the resolv.conf search domain
  to the first query, which could return a false result
- Add a visible warning in the scan header when scanning by IP
  address, noting that trust/CAA and other domain-specific checks
  may be unreliable and the user should rescan with the hostname
2026-05-25 17:01:11 +02:00
Dirk Wetter 2f51cff728 Merge pull request #3039 from phpipam/3.3dev
Added link to php-ssl Certificate scanning integration
2026-05-19 17:27:07 +02:00
Dirk Wetter 84235d35c0 Merge pull request #3038 from testssl/more_handshakes_updates
Client handshake updates
2026-05-18 22:14:26 +02:00
Dirk 7871d800f9 adjust baseline runner output 2026-05-18 21:30:57 +02:00
Dirk 01b7ad7cc8 correct name 2026-05-18 21:30:34 +02:00
Dirk 56697cee48 Consolidate handshakes for all Safaris 26.4
Looked before at ja3, but for Chromium-browsers ja4 is relevant.
The client column needed to be extended with 1 space.
2026-05-18 21:16:43 +02:00
Dirk b4e58dfbb5 Consolidated Handshakes
went through a couple of pcap files and determined ja3 + ja4 sums.

- Android 15/16 are the same (previously ja3 taken instead of ja4 and wrong host. One has to use chrome !)
- Edge 101/Chrome 101 are the same (will be deprated next time)
- surprisingly Java 17.0.3 and 21.0.6 were the same.

- Added: Ja3/ja4 for old Apple Mail and Thunderbird
2026-05-18 18:45:04 +02:00
Dirk 7897cdcd84 Android 16
As mentioned in the comment: For Androids ja3 is is not unique, probably because of GREASE.
One can add two handshakes after another and they are different. ja4 seems more consistent here.

This should be kept in mind for all clients "supplying some grease"
2026-05-18 16:50:06 +02:00
Miha Petkovšek bedd224aa7 Added link to php-ssl Certificate scanning integration 2026-05-18 16:31:20 +02:00
Dirk 56e4a74485 Add OpenSSL 4.0 2026-05-17 15:23:42 +02:00
Dirk a35e9f816d Broaden table for client simulation
... as some clients are the same and space wasn't enough.
2026-05-16 16:14:24 +02:00
Dirk dd4c0b371d Handshakes for iOS + iPadOS 26.4. added 2026-05-16 16:04:13 +02:00
Dirk 7be3897437 Update MacOS/Safari 26.4
it has PQC kx finally, whohoo
2026-05-15 21:31:06 +02:00
Dirk 14e8df3fab Update readme wrt ja3/ja4 + imotr tweaks 2026-05-15 21:30:07 +02:00
Dirk 60131b4b5d - Update Apple Client Simulations 2026-05-15 21:28:54 +02:00
Dirk Wetter 0e59b983f1 Merge pull request #3030 from testssl/fix_unicode_3003
Fix DN conversion when reading certificate issuer
2026-04-22 15:34:21 +02:00
Dirk Wetter 146605e740 Merge pull request #3031 from testssl/fix_doc-problem_3029
Fix doc error regarding MAX_SOCKET_FAIL + MAX_OSSL_FAIL
2026-04-20 18:58:51 +02:00
Dirk b773fa9939 Fix doc error regarding MAX_SOCKET_FAIL + MAX_OSSL_FAIL
The trailing error messages were swapped in the paragraphs /
description for MAX_SOCKET_FAIL + MAX_OSSL_FAIL .

This fixes the confusion for 3.3dev , see #3028 .
2026-04-20 18:43:59 +02:00
Dirk b573a4f786 Fix DN conversion when reading certificate issuer
This fixes #3003 .

The conversion to proper UTF-8 should have taken place by just using
`-nameopt RFC2253`, see manpage openssl-namedisplay-options(1ssl).

As @dcooper16 suggested removing esc_msb should help. This may look
counterintuitive but works.
2026-04-20 18:09:36 +02:00
Dirk Wetter d2d684e31b Merge pull request #3029 from testssl/fix_fix_2809
Address missing extended_master secret extension properly
2026-04-20 17:49:24 +02:00
Dirk cff949bb90 Address missing extended_master secret extension properly
This PR "fixes feature" #2809 which was formerly not properly implemented in #2982,
see comment https://github.com/testssl/testssl.sh/issues/2806#issuecomment-4164847538.

Now TLS 1.3.-only servers won't get penalized when the master secret extension
is missing.
2026-04-20 16:31:44 +02:00
Dirk Wetter 7c47d8a8eb Merge pull request #3023 from dcooper16/identity_ossl_tls13_ciphers
Identify TLS 1.3 ciphers by OpenSSL name
2026-04-17 11:59:10 +02:00
Dirk Wetter 24eb5dec8a Merge pull request #3024 from dcooper16/missing_groups
Add missing TLS 1.3 Brainpool groups
2026-04-15 11:41:14 +02:00
David Cooper 74a60d25ea Identity TLS 1.3 ciphers by OpenSSL name
This commit changes the way that TLS 1.3 ciphers are identified by the OpenSSL names. To the degree possible, rather than checking for prefixes that have historically been used in various versions of OpenSSL and LibreSSL, the cipher name being checked against the known list of TLS 1.3 cipher suites that $OPENSSL supports.

In the few places in which the cipher suite name to be checked may not be supported by $OPENSSL, a check for the prefix "TLS_" is also used.
2026-04-14 14:46:48 -07:00
David Cooper 4b3a133a50 Add missing TLS 1.3 Brainpool groups
This commit adds recognition of the TLS 1.3 Brainpool groups when parsing the supported_groups extension in the server's extensions.
2026-04-13 12:58:31 -07:00
Dirk Wetter 57cca5c2a0 Merge pull request #3020 from dcooper16/use_sigalgs
Use OpenSSL with -sigalgs option to obtain server's certificate
2026-04-13 09:36:47 +02:00
Dirk Wetter 93ae5d78f4 Merge pull request #3021 from dcooper16/missing_sigschemes
Add missing TLS signature schemes
2026-04-13 09:34:20 +02:00
David Cooper 000a5c40cf Add missing TLS signature schemes
This commit fixes a few places where new signature schemes were not added:

1) It adds ECDSA with the Brainpool curves for TLS 1.3 (0x081a, 0x081b, and 0x081c) to get_server_certificate(), certificate_transparency(), and prepare_tls_clienthello().

2) It adds rsa_pss_pss (0x0809, 0x080a, 0x080b) to certificate_transparency().

3) It adds the signature schemes for EdDSA (0x0807, 0x0808) and ML-DSA (0x0904, 0x0905, 0x0906) to certificate_transparency().
2026-04-12 11:27:00 -07:00
David Cooper 087ddd141e Use OpenSSL with -sigalgs option to obtain server's certificate
When $OPENSSL s_client supports the "-sigalgs" option, get_server_certificate() uses $OPENSSL rather than tls_sockets() to obtain the server's certificate, but only for certificates with RSA and ECDSA public keys.

With OpenSSL 3.5 and newer the list command can be used to get a list of supported TLS signature algorithms.

With this commit, if OpenSSL 3.5 or newer is being used, the list of supported TLS signature algorithms is obtained and get_server_certificate() uses $OPENSSL s_client rather than tls_sockets() whenever $OPENSSL supports the relevant signature scheme.

In addition to making the code a bit faster, this may be helpful if a server has a certificate with an SM2 public key and it only supports curveSM2 for key exchange, since tls_sockets() can not decrypt server responses if curveSM2 is used.
2026-04-12 11:26:12 -07:00
Dirk Wetter e3ec72a359 Merge pull request #3018 from dcooper16/ossl4_ocsp
OpenSSL 4 compatibility for stapled OCSP responses
2026-04-12 13:24:01 +02:00
David Cooper a0b1f13b84 OpenSSL 4 compatibility for stapled OCSP responses
It seems that OpenSSL 4.0.0 allows for the possibility that a server's response to the status request extension may include more than one OCSP response (presumably one for each certificate in the certification path).

As a result, the line indicating that the server does not provide status information was changed from "OCSP response: no response sent" to "OCSP responses: no responses sent". If a response was included, "OCSP responses:" is followed by an indication of the number of responses included.

This commit addresses the change from "response" to "responses".

I do not know of any servers that provide more than one OCSP response, so I have not tried to make any changes to handle more than one response.
2026-04-11 15:26:10 -07:00
Dirk Wetter b14ed4def5 Merge pull request #3017 from dcooper16/tls_data
Clean up etc/tls_data.txt
2026-04-11 11:22:17 +02:00