Skip to content
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

[#3582] Fix env setup in 'Getting Started' guide. #3583

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

calohmn
Copy link
Contributor

@calohmn calohmn commented Nov 12, 2023

This fixes #3582 .

When connecting to a local Hono instance using the IP obtained from the K8s Service, the hostname verification as part of the TLS connection attempt will not work for the demo certs. Therefore the --insecure option has to be added to the curl and mosquitto_pub/sub commands. For mosquitto_pub/sub, the --insecure option will disable only the hostname verification. For curl, there is no separate command line option for that (equivalent to the CURLOPT_SSL_VERIFYHOST libcurl option), hence the need to use --insecure, disabling certificate checking.
(There would be an alternative to curl --insecure, using the parameter --resolve "hono-service-device-registry.hono:28443:${REGISTRY_IP}" and hono-service-device-registry.hono as host in the URL, but this may be a bit confusing.)

@calohmn calohmn added this to the 2.5.0 milestone Nov 12, 2023
@@ -189,10 +189,10 @@ echo "export HTTP_ADAPTER_IP=$(kubectl get service eclipse-hono-adapter-http --o
echo "export MQTT_ADAPTER_IP=$(kubectl get service eclipse-hono-adapter-mqtt --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)" >> hono.env
KAFKA_IP=$(kubectl get service eclipse-hono-kafka-0-external --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)
TRUSTSTORE_PATH=/tmp/truststore.pem
kubectl get secrets eclipse-hono-kafka-example-keys --template="{{index .data \"ca.crt\" | base64decode}}" -n hono > ${TRUSTSTORE_PATH}
kubectl get configmaps eclipse-hono-example-trust-store --template="{{index .data \"ca.crt\"}}" -n hono > ${TRUSTSTORE_PATH}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: The change in addressing the ca.crt for the $TRUSTSTORE_PATH via
kubectl get configmaps eclipse-hono-example-trust-store
instead of
kubectl get secrets eclipse-hono-kafka-example-keys
means that the Hono chart
example/certs/trusted-certs.pem
instead of
example/certs/ca-cert.pem
is used.

Without this change, mosquitto_pub/sub will return an error:
OpenSSL Error[0]: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

It seems that the example/certs/root-cert.pem included in example/certs/trusted-certs.pem is needed.

Copy link
Contributor

@sophokles73 sophokles73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@calohmn calohmn merged commit d926871 into eclipse-hono:master Nov 13, 2023
3 checks passed
@calohmn calohmn deleted the PR/fix_getting_started branch November 13, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors following the Getting Started Guide using local Hono instance
2 participants