Loading a custom key store in Google App Engine Java application

前端 未结 4 816
孤城傲影
孤城傲影 2020-12-14 17:44

I want to open a HTTPS connection in a Google App Engine app using the URLFetch service. To be able to verify the SSL certificate of the server my a

4条回答
  •  攒了一身酷
    2020-12-14 18:16

    I have had a similar problem... I needed a keystore.p12 to call a foreign web service but had no chance loading it from the classpath. The only way I was able to use it was to put it in e.g. /WEB-INF/keystore.p12 and load it from there.

    ServletContext context = getContext();
    URL resourceUrl = context.getResource("/WEB-INF/keystore.p12");
    

提交回复
热议问题