Access HAPI FHIR Docker Image using HTTPS

瀏覽次數:53 次
跳到第一則未讀訊息

Heath Frankel

未讀,
2022年1月13日 清晨6:18:492022/1/13
收件者:HAPI FHIR
Hi, I am able to run the HAPI FHIR Docker image using port 8080 but only using http. Can I access it using https? 

Jordan Miller

未讀,
2022年1月14日 下午1:23:472022/1/14
收件者:HAPI FHIR
We had a similar need and accomplished this by modifying the dockerfile to generate a self signed certificate and then updating the server.xml for tomcat to enable https. For reference here are the snippets from the dockerfile and server.xml

NOTE: Your server.xml file has a lot more than just this snippet... so if you replace the file make sure to get the full file not just the snippet below.

Snippet from final stage of the dockerfile
RUN mkdir /usr/local/tomcat/ssl
RUN openssl req -x509 -nodes -days 10950 -newkey rsa:2048 -keyout /usr/local/tomcat/ssl/selfsigned-key.pem -out /usr/local/tomcat/ssl/selfsigned-cert.pem -subj /C=US/ST=Statename/O=Orgname/CN=selfsignedcert
COPY server.xml /usr/local/tomcat/conf/server.xml

Snippet from server.xml
 <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="ssl/selfsigned-key.pem"
                         certificateFile="ssl/selfsigned-cert.pem"
certificateKeyPassword="changeit"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>

Heath Frankel

未讀,
2022年3月18日 清晨5:03:512022/3/18
收件者:HAPI FHIR
Thanks Jordan, that pointed me in the right direction. Much appreciated.
回覆所有人
回覆作者
轉寄
0 則新訊息