-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Elasticsearch CA certificates are rejected by Python 3.13 #117769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Pinging @elastic/es-security (Team:Security) |
slobodanadamovic
added a commit
to slobodanadamovic/elasticsearch
that referenced
this issue
Apr 8, 2025
…astic#126376) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes elastic#117769
slobodanadamovic
added a commit
to slobodanadamovic/elasticsearch
that referenced
this issue
Apr 8, 2025
…astic#126376) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes elastic#117769 (cherry picked from commit 284121a) # Conflicts: # docs/reference/elasticsearch/command-line-tools/certutil.md
elasticsearchmachine
pushed a commit
that referenced
this issue
Apr 8, 2025
…26376) (#126447) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes #117769
elasticsearchmachine
added a commit
that referenced
this issue
Apr 8, 2025
…26376) (#126448) * Set `keyUsage` for generated HTTP certificates and self-signed CA (#126376) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes #117769 (cherry picked from commit 284121a) # Conflicts: # docs/reference/elasticsearch/command-line-tools/certutil.md * fix compilation error * [CI] Auto commit changes from spotless * fix failing test --------- Co-authored-by: elasticsearchmachine <[email protected]>
slobodanadamovic
added a commit
to slobodanadamovic/elasticsearch
that referenced
this issue
Apr 8, 2025
…astic#126376) (elastic#126448) * Set `keyUsage` for generated HTTP certificates and self-signed CA (elastic#126376) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes elastic#117769 (cherry picked from commit 284121a) # Conflicts: # docs/reference/elasticsearch/command-line-tools/certutil.md * fix compilation error * [CI] Auto commit changes from spotless * fix failing test --------- Co-authored-by: elasticsearchmachine <[email protected]>
slobodanadamovic
added a commit
to slobodanadamovic/elasticsearch
that referenced
this issue
Apr 8, 2025
…astic#126376) (elastic#126448) * Set `keyUsage` for generated HTTP certificates and self-signed CA (elastic#126376) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes elastic#117769 (cherry picked from commit 284121a) # Conflicts: # docs/reference/elasticsearch/command-line-tools/certutil.md * fix compilation error * [CI] Auto commit changes from spotless * fix failing test --------- Co-authored-by: elasticsearchmachine <[email protected]>
elasticsearchmachine
added a commit
that referenced
this issue
Apr 8, 2025
…26376) (#126448) (#126454) * Set `keyUsage` for generated HTTP certificates and self-signed CA (#126376) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes #117769 (cherry picked from commit 284121a) # Conflicts: # docs/reference/elasticsearch/command-line-tools/certutil.md * fix compilation error * [CI] Auto commit changes from spotless * fix failing test --------- Co-authored-by: elasticsearchmachine <[email protected]>
elasticsearchmachine
added a commit
that referenced
this issue
Apr 8, 2025
…26376) (#126448) (#126453) * Set `keyUsage` for generated HTTP certificates and self-signed CA (#126376) The `elasticsearch-certutil http` command, and security auto-configuration, generate the HTTP certificate and CA without setting the `keyUsage` extension. This PR fixes this by setting (by default): - `keyCertSign` and `cRLSign` for self-signed CAs - `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs These defaults can be overridden when running `elasticsearch-certutil http` command. The user will be prompted to change them as they wish. For `elasticsearch-certutil ca`, the default value can be overridden by passing the `--keysage` option, e.g. ``` elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem ``` Fixes #117769 (cherry picked from commit 284121a) # Conflicts: # docs/reference/elasticsearch/command-line-tools/certutil.md * fix compilation error * [CI] Auto commit changes from spotless * fix failing test --------- Co-authored-by: elasticsearchmachine <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Elasticsearch Version
8.16.1
Installed Plugins
No response
Java Version
bundled
OS Version
Darwin arm64
Problem Description
Python 3.13 (released in October 2024) enabled by default the VERIFY_X509_STRICT flag for improved RFC 5280 compliance. This setting maps to the X509_V_FLAG_X509_STRICT OpenSSL flag documented as:
The CA certificates generated by Elasticsearch (either by default on startup) or by elasticsearch-certutil are not compliant, at least because they're missing the key usage extension.
Steps to Reproduce
Run Elasticsearch:
Try connecting to it using the Elasticsearch Python client:
This fails with:
Alternatively, you can inspect the
http_ca.crt
file:$ openssl x509 -in http_ca.crt -text -noout Certificate: Data: Version: 3 (0x2) Serial Number: a4:50:12:ea:89:c9:78:fe:9e:9a:4b:7c:64:18:e0:13:04:d6:fb:58 Signature Algorithm: sha256WithRSAEncryption Issuer: CN=Elasticsearch security auto-configuration HTTP CA Validity Not Before: Nov 29 14:07:47 2024 GMT Not After : Nov 29 14:07:47 2027 GMT Subject: CN=Elasticsearch security auto-configuration HTTP CA Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (4096 bit) Modulus: [...]] Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: F4:BC:A2:F5:ED:8B:FD:93:F2:AE:76:82:A2:58:9E:EE:58:82:B9:BC X509v3 Authority Key Identifier: F4:BC:A2:F5:ED:8B:FD:93:F2:AE:76:82:A2:58:9E:EE:58:82:B9:BC X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption Signature Value: [...]
In
X509v3 extensions
, you can see that theKey Usage
extension is missing. If by contrast, I'm looking at the test CA certificate generated by trustme and used in the Python client:You can see that
Key Usage
is included, and indeed connections to Python 3.13 work.Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: