我无法让 HTTPS URL 与 betamax 一起使用。
它类似于下面发布的其他问题,但是我已经完成了 betamax.pem 文件导入,它似乎没有任何效果:
这是我运行的导入命令:
c:\Users\UserAccount>"%JAVA_HOME%/bin/keytool.exe" -importcert -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file betamax.pem -alias betamax -storepass changeit -noprompt
这是我的配置:
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
}
产生:
javax.net.ssl.SSLException: hostname in certificate didn't match: <discuss.gradle.org> != <*.discourse.org> OR <*.discourse.org> OR <discourse.org>
谁能看到我做错了什么?
以下是类似问题的报告: Betamax 无法记录 HTTPS 流量