ppazos / notes

Apache License 2.0
0 stars 0 forks source link

EHRServer HTTPS connections not grabbing the jks keystore #55

Open ppazos opened 6 years ago

ppazos commented 6 years ago

Need to check the resource path in the ehrserver groovy client to see if the JKS is loaded.

https://github.com/ppazos/cabolabs-ehrserver-groovy/blob/master/src/com/cabolabs/ehrserver/EHRServerClient.groovy#L58-L62

This exception happens here: https://github.com/ppazos/cabolabs-ehrserver-groovy/blob/master/src/com/cabolabs/ehrserver/EHRServerClient.groovy#L125-L154

server https://server001.cloudehrserver.com:443/
Creating missing EHR for patient Manuel
server https://server001.cloudehrserver.com:443/
Extra config needs to be done for HTTPS connections, see https://github.com/jgritman/httpbuilder/wiki/SSL 
Use the cabolabs2.crt certificate and the store.jks keystore from this project to run the tests
cabolabs-ehrserver-groovy>keytool -importcert -alias "cabo2-ca" -file cabolabs2.crt -keystore store.jks -storepass test1234
Base URL: https://server001.cloudehrserver.com:443/
peer not authenticated
2018-04-29 15:38:35.601 ERROR --- [           main] o.s.boot.SpringApplication               : Application startup failed

groovy.lang.MissingPropertyException: No such property: response for class: javax.net.ssl.SSLPeerUnverifiedException
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
        at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:66)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
        at com.cabolabs.ehrserver.EhrServerClient.login(EHRServerClient.groovy:154)
ppazos commented 6 years ago

check

https://stackoverflow.com/questions/2308774/httpget-with-https-sslpeerunverifiedexception

https://stackoverflow.com/questions/27724544/specifying-trust-store-information-in-spring-boot-application-properties

https://stackoverflow.com/questions/26427799/how-to-force-grails-to-use-a-signed-certificate-with-run-app-or-run-war

https://stackoverflow.com/questions/31033751/embedded-tomcat-enable-ssl

https://stackoverflow.com/questions/18889058/programmatically-import-ca-trust-cert-into-existing-keystore-file-without-using/18889390#18889390

https://stackoverflow.com/questions/36769351/grails-3-force-https-by-default

https://stackoverflow.com/questions/29273176/how-to-include-extra-files-when-building-a-war

https://stackoverflow.com/questions/30238592/where-to-place-resources-in-grails-3-project

ppazos commented 6 years ago

The certificate of the server is frequently updated, so we need a method for notes to grab an updated certificate from time to time and use that.

Check https://github.com/escline/InstallCert/blob/master/InstallCert.java