kong icon indicating copy to clipboard operation
kong copied to clipboard

Custom certificates not being used when upgrading from 2.2.0 to 2.5.0

Open jeffyanta opened this issue 3 years ago • 5 comments

Summary

  • Kong version ($ kong version): 2.5.0
  • After upgrading to 2.5.0 from 2.2.0, custom certificate is not used. Kong falls back to its self-signed certificate.

Steps To Reproduce

We are using Kong to proxy gRPC traffic. We've setup a custom certificate by setting the following env variables:

KONG_NGINX_PROXY_SSL_CERTIFICATE:         /etc/secrets/kong-grpc-proxy-ssl-cert/chained.pem
KONG_NGINX_PROXY_SSL_CERTIFICATE_KEY:     /etc/secrets/kong-grpc-proxy-ssl-key/key.pem
KONG_NGINX_PROXY_SSL_CLIENT_CERTIFICATE:  /etc/secrets/kong-grpc-proxy-client-cert/ca.crt

Upon upgrading from 2.2.0 to 2.5.0, Kong is now using its own self-signed certificate, causing clients to fail on TLS.

Additional Details & Logs

jeffyanta avatar Jul 21 '21 17:07 jeffyanta

I've narrowed down that the issue started in 2.3.0.

jeffyanta avatar Jul 22 '21 14:07 jeffyanta

Hi @jeffyanta! Can you please share the command line used to start Kong and the rendered nginx-kong.conf? If for some reason those environment variable values are not being rendered there, it's not going to work.

locao avatar Jul 28 '21 17:07 locao

@locao We're deploying Kong to k8s via your Helm chart (version 1.9.1), so we're using the default Docker entrypoint. I am seeing the configuration being injected under the nginx_proxy_* directives section in nginx-kong.conf when I exec into a pod.

jeffyanta avatar Jul 29 '21 16:07 jeffyanta

The values that are being injected:

ssl_certificate /etc/secrets/kong-grpc-proxy-ssl-cert/chained.pem;
ssl_certificate_key /etc/secrets/kong-grpc-proxy-ssl-key/key.pem;
ssl_client_certificate /etc/secrets/kong-grpc-proxy-client-cert/ca.crt;

jeffyanta avatar Jul 29 '21 16:07 jeffyanta

The fix is to use the ssl_cert and ssl_cert_key helm config options rather than the nginx directives.

scottsweezey avatar Jul 31 '22 14:07 scottsweezey

@jeffyanta Does the suggestion above solve the issue for you? Please reopen if not.

gszr avatar Jan 10 '23 17:01 gszr