问题
I want to consume a web service that is using an invalid certificate (self signed)
I want to make the web service call without performing any sort of certificate validation.
How do I do it?
回答1:
In your application.conf add the below line
ws.acceptAnyCertificate=true
回答2:
By the way, if you going to user play2 as a lib, to allow self-signed ssl certificates you should do the following(2.1.3 as actual version):
create conf/application.conf with at least one string
ws.acceptAnyCertificate=true
create new application
val app = new play.api.DefaultApplication(new File("."), this.getClass.getClassLoader(), None, play.api.Mode.Dev)
start new app
play.api.Play.start(app)
do ws calls to https resources
来源:https://stackoverflow.com/questions/18073518/how-do-i-ignore-ssl-validation-in-play-framework-scala-ws-calls