The Trav
The Trav

Reputation: 2005

How do I ignore ssl validation in play framework scala ws calls

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?

Upvotes: 6

Views: 4159

Answers (2)

Alex Povar
Alex Povar

Reputation: 4960

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

Upvotes: 0

Adam
Adam

Reputation: 314

In your application.conf add the below line

ws.acceptAnyCertificate=true

Upvotes: 10

Related Questions