I can't get HTTPS URL's working with betamax.
It's similar to this other issue posted below, however I've already done the betamax.pem file import and it seems to have had no effect:
Here's the import command I ran:
c:\Users\UserAccount>"%JAVA_HOME%/bin/keytool.exe" -importcert -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file betamax.pem -alias betamax -storepass changeit -noprompt
Here is my config:
static final File TAPES =
new File(System.getProperty('BETAMAX_TAPEDIR') ?:
'src/integrationTest/resources/betamax/tapes')
static final TapeMode TAPEMODE =
System.getProperty('BETAMAX_MAKETAPES') ?
TapeMode.READ_WRITE :
TapeMode.READ_ONLY
static final Integer PROXYPORT =
System.getProperty('BETAMAX_PROXYPORT') ?
System.getProperty('BETAMAX_PROXYPORT').toInteger() :
Configuration.DEFAULT_PROXY_PORT
@Shared
Configuration configuration = Configuration.builder()
.tapeRoot(TAPES)
.ignoreLocalhost(false)
.defaultMode(TAPEMODE)
.proxyPort(PROXYPORT)
.sslEnabled(true)
.build()
@Rule
RecorderRule recorder = new RecorderRule(configuration)
@Betamax(tape='GradleNews.tape')
def "Try record HTTPS"()
{
when:
def http = new RESTClient('https://discuss.gradle.org')
http.head path: 'c/books-articles'
then:
true
}
Which produces:
javax.net.ssl.SSLException: hostname in certificate didn't match: <discuss.gradle.org> != <*.discourse.org> OR <*.discourse.org> OR <discourse.org>
Can anyone see what I'm doing wrong?
Here's a report of a similar issue: Betamax fails to record HTTPS traffic