You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observe that prepper cannot connect to Opensearch, it complains about hostname validation, even if insecure is set.
Remove the cert line and try again
Now prepper can connect to your opensearch
Expected behavior
The documentation says the following for the two settings:
cert (Optional) : CA certificate that is pem encoded. Accepts both .pem or .crt. This enables the client to trust the CA that has signed the certificate that the OpenSearch cluster is using. Default is null. insecure (Optional): A boolean flag to turn off SSL certificate verification. If set to true, CA certificate verification will be turned off and insecure HTTP requests will be sent. Default to false.
These two are by definition mutual exclusive. But the documentation does not talk about their relationship or the fact that cert will override insecure. The principle of least surprise would be that insecure: true overrides the presence of cert, not the other way around. You'd also expect a warning in the log whenever this is the case.
//We will set insecure flag only if certPath is null
builder = builder.withInsecure(insecure);
}
Environment (please complete the following information):
Kubernetes
Opensearch helm chart
Data prepper helm chart
Opensearch demo certificates
Additional context
The k8s service has a different name than the CN in auto generated demo certificates. Since the Data prepper is configured to talk to the servicename, there is a host name verification error when using the pem cert from opensearch.
The text was updated successfully, but these errors were encountered:
janhoy
changed the title
[BUG][opensearch exporter] Config option 'insecure' not honored when 'cert' is configured
[BUG][opensearch sink] Config option 'insecure' not honored when 'cert' is configured
Dec 17, 2024
Describe the bug
The
insecure
option should overridecert
, not the other way around.To Reproduce
Steps to reproduce the behavior:
cert
andinsecure
in config:insecure
is set.cert
line and try againExpected behavior
The documentation says the following for the two settings:
These two are by definition mutual exclusive. But the documentation does not talk about their relationship or the fact that
cert
will overrideinsecure
. The principle of least surprise would be thatinsecure: true
overrides the presence ofcert
, not the other way around. You'd also expect a warning in the log whenever this is the case.Screenshots
Code that disregards
insecure
flag:data-prepper/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/ConnectionConfiguration.java
Lines 276 to 283 in 956a89a
Environment (please complete the following information):
Additional context
The k8s service has a different name than the CN in auto generated demo certificates. Since the Data prepper is configured to talk to the servicename, there is a host name verification error when using the
pem
cert from opensearch.The text was updated successfully, but these errors were encountered: