testing - 步骤 ‘Run Tests on AWS Device Farm’ 由于异常 : javax.net.ssl.SSLHandshakeException 而中止:无法生成 secret

标签 testing mobile jenkins jenkins-plugins aws-device-farm

我正在尝试将 Jenkins 与 AWS Device Farm 集成以自动化移动设备测试。 因此,我创建了一个 IAM 用户并将 devicefarm 策略附加到该用户。 生成 AWS 访问 key ID 和 AWS secret key ID,并在 jenkins 管理配置中提供。

But the Post-build Actions to Run Tests on AWS Device Farm leads to below exception. Could anyone be able to help me?

异常堆栈如下:

[AWSDeviceFarm] Using Project 'BMS_OPDVO'
[AWSDeviceFarm] Using DevicePool 'LG Nexus5'
[AWSDeviceFarm] Using App '**/target/resources/org.wordpress.android.5.0.apk'
[AWSDeviceFarm] Archiving artifact 'org.wordpress.android.5.0.apk'
[AWSDeviceFarm] Uploading org.wordpress.android.5.0.apk to S3
ERROR: Step ‘Run Tests on AWS Device Farm’ aborted due to exception: 
javax.net.ssl.SSLHandshakeException: Could not generate secret
    at sun.security.ssl.ECDHCrypt.getAgreedSecret(ECDHCrypt.java:103)
    at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1067)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:348)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:290)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:259)
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:125)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
    at org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarm.upload(AWSDeviceFarm.java:359)
    at org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarm.upload(AWSDeviceFarm.java:330)
    at org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarm.upload(AWSDeviceFarm.java:317)
    at org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarm.uploadApp(AWSDeviceFarm.java:211)
    at org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarmRecorder.perform(AWSDeviceFarmRecorder.java:287)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:408)
Caused by: java.security.InvalidKeyException: ECDH key agreement requires ECPublicKey for doPhase
    at org.bouncycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.engineDoPhase(Unknown Source)
    at javax.crypto.KeyAgreement.doPhase(KeyAgreement.java:567)
    at sun.security.ssl.ECDHCrypt.getAgreedSecret(ECDHCrypt.java:100)
    ... 34 more

最佳答案

异常主要是因为 jenkins 和 s3 服务器之间的 ssl 握手没有发生。

我已经安装了skip certificate check plugin 并重新启动了忽略 ssl 握手错误的 jenkins 服务器并继续操作。

关于testing - 步骤 ‘Run Tests on AWS Device Farm’ 由于异常 : javax.net.ssl.SSLHandshakeException 而中止:无法生成 secret ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35645057/

相关文章:

python - Pytest - 重用为不同用户提供不同输出的固定装置

javascript - Mobile Safari 键盘表单提交

android - 是否有可能将 Ionic 应用程序构建到现有的 Native 应用程序中

jenkins - 如何从另一个 Jenkins 共享库调用函数

maven - 当 docker-maven 插件尝试构建镜像时会发生什么?

java - 如何永久解决 Jenkins 中显示范围报告的 HTML Publisher 插件问题?

javascript - 当我将 KnockoutJS 导入我正在测试的 ViewModel 时,为什么 Jest 错误超过最大调用堆栈大小?

firefox - 帮助我在 Win7 上填写表格的免费工具/提示?

php - 当我尝试测试对基于 PHP 的服务器的请求时,我应该使用 Java 或 Python 中的哪种数据结构,该服务器需要带有字符串索引的数组?

css - 如何隐藏移动版博客的标题?