yamlquarkusapplication.properties

Setup 'trust-certificate-pem' property in YAML config format


Im trying to setup a trust certificate in my Quarkus application for my postgres connection.
Sadly I wasted my time yesterday, by not noticing that I configured the property wrong.
That lead to a io.vertx.core.VertxException: SSL handshake failed error.

The main cause was that I converted the example config of application.properties wrong to the application.yml format, since I am using the YAML extension. After testing the application properties variant it worked.

Now the question: How do I set is up correctly in YML format ?

# Working application.properties format
quarkus.datasource.reactive.trust-certificate-pem=true
quarkus.datasource.reactive.trust-certificate-pem.certs=somefile.pem
# Wrong YAML formats, which I have tried so far

# V1
quarkus:
   datasource:
      reactive:
         trust-certificate-pem: true
         trust-certificate-pem:
            certs: somefile.pem

#V2
quarkus:
   datasource:
      reactive:
         trust-certificate-pem: true
         trust-certificate-pem.certs: somefile.pem


#V3
quarkus:
   datasource:
      reactive:
         trust-certificate-pem: true
         trust-certificate-pem.certs: somefile.pem

#V4
quarkus:
   datasource:
      reactive:
         trust-certificate-pem:
            value: true
            certs: somefile.pem

Anyone got an idea ?
I really wished the Quarkus team had a toggle switch to see a YAML example :/


Solution

  • YAML specification has a miscellaneous tag for null. This is the ~ (tilde) sign.

    The following config will work

    quarkus:
      datasource:
        reactive:
          trust-certificate-pem:
            ~: true
            certs: somefile.pem