Add certificate to truststore to enable SSL communication

前端 未结 2 690
傲寒
傲寒 2020-12-12 02:52

How do I add a certificate to the trust store when application is running in bluemix. Is there any way to update cacert, either programmatically or using cli?

Any d

2条回答
  •  死守一世寂寞
    2020-12-12 03:40

    You could try using the spring-boot-ssl-truststore-gen which adds the certificate to the system truststore inside the buikdpack:

    First you need this in your pom.xml (or alternative):

    
       
          jcenter
          http://jcenter.bintray.com 
          
            true
            never
            warn
          
           
             true
             warn
          
       
     
    

    and

    
        com.orange.clara.cloud.boot.ssl-truststore-gen
        spring-boot-ssl-truststore-gen
        2.0.21
    
    

    Next declare the certificate in your manifest.yml:

    env:
        TRUSTED_CA_CERTIFICATE: |-
            -----BEGIN CERTIFICATE-----
            changeme
            -----END CERTIFICATE-----
    

    That's it. When you cf push your application, the certificate will get added to the truststore.

提交回复
热议问题