【问题标题】:keytool error: java.lang.RuntimeException: java.io.IOException: DNSName components must begin with a letter << Command failed, code: 1keytool 错误:java.lang.RuntimeException:java.io.IOException:DNSName 组件必须以字母 << 命令失败,代码:1
【发布时间】:2018-05-28 07:08:58
【问题描述】:

这个问题已经有了答案here

从过去几天开始,我正在与jmeter 合作。它运行良好。

但是今天当我尝试使用http 脚本记录器录制新脚本时,当我点击开始时,我遇到了异常..

java.io.IOException:   >> keytool error: java.lang.RuntimeException: java.io.IOException: DNSName components must begin with a letter <<
Command failed, code: 1
'keytool -genkeypair -alias 104.211.242.218 -dname "cn=104.211.242.218, o=JMeter Proxy (TEMPORARY TRUST ONLY)" -keyalg RSA -keystore proxyserver.jks -storepass {redacted} -keypass {redacted} -validity 7 -ext san=dns:104.211.242.218'
    at org.apache.jorphan.exec.KeyToolUtils.genkeypair(KeyToolUtils.java:171) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jorphan.exec.KeyToolUtils.generateSignedCert(KeyToolUtils.java:285) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jorphan.exec.KeyToolUtils.generateHostCert(KeyToolUtils.java:276) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.initDynamicKeyStore(ProxyControl.java:1540) ~[ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.initKeyStore(ProxyControl.java:1447) ~[ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.startProxy(ProxyControl.java:530) [ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.startProxy(ProxyControlGui.java:569) [ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.actionPerformed(ProxyControlGui.java:424) [ApacheJMeter_http.jar:4.0 r1823414]
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) [?:1.8.0_131]
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) [?:1.8.0_131]
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) [?:1.8.0_131]
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source) [?:1.8.0_131]
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) [?:1.8.0_131]
    at java.awt.Component.processMouseEvent(Unknown Source) [?:1.8.0_131]
    at javax.swing.JComponent.processMouseEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.Component.processEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.Container.processEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.Component.dispatchEventImpl(Unknown Source) [?:1.8.0_131]
    at java.awt.Container.dispatchEventImpl(Unknown Source) [?:1.8.0_131]
    at java.awt.Component.dispatchEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.Container.dispatchEventImpl(Unknown Source) [?:1.8.0_131]
    at java.awt.Window.dispatchEventImpl(Unknown Source) [?:1.8.0_131]
    at java.awt.Component.dispatchEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_131]
    at java.awt.EventQueue.access$500(Unknown Source) [?:1.8.0_131]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_131]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_131]
    at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_131]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_131]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_131]
    at java.awt.EventQueue$4.run(Unknown Source) [?:1.8.0_131]
    at java.awt.EventQueue$4.run(Unknown Source) [?:1.8.0_131]
    at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_131]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_131]
    at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_131]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_131]
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_131]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_131]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_131]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_131]
    at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_131]

【问题讨论】:

    标签: jmeter jmx jmeter-plugins


    【解决方案1】:

    这可能是由于bug in Java 造成的,因为有很多域以数字开头,例如

    所以选项在:

    【讨论】:

    • 另一种选择是将jmeter升级到5.1或更高版本,jmeter解决了这个问题。