Tag: ssl

如何设置java keytool的默认语言?

我使用Windows操作系统,英语和美式键盘设置。 我使用此命令生成密钥库。 它工作正常。 C:\java6\jre\bin\keytool -genkey -keyalg RSA -alias mykey -validity 3652 -keystore C:\mykeystore -storepass 111111111 < data.txt data.txt My name My org unit My org My city My state ch yes 但是,此程序无法在具有德语和键盘设置的Windows上正常工作。 我必须在data.txt中将“ yes ”“更改为” ja “以使其有效。 修改data.txt是不好的。 有没有办法将英语设为keytool的默认语言?

PKCS12到JKS转换失败

我正在尝试使用以下命令将PKCS12格式文件转换为JKS密钥库: keytool -v -importkeystore -trustcacerts -srckeystore cert.p12 -srcstoretype PKCS12 -destkeystore md_keystore.jks -deststoretype JKS 这将返回以下消息: 0 entries successfully imported, 0 entries failed or cancelled 我已经使用openSSL查看了cert.p12文件,看起来很好 – 它包含完整的证书链和私钥。 也没有返回堆栈跟踪,生成的密钥库文件也是空的。 任何人都有任何想法为什么密钥库无法导入看似有效的证书,但没有产生任何堆栈跟踪等?

连接到https站点(服务器)

我有一些java-app,我想建立一个连接到一些https网站,我怎么能这样做,使用URLConnection? 我是否应该使用信任存储,当使用有效的证书颁发机构签署此站点的证书时?

创建Web服务客户端时,没有主题备用名称存在exception

我想使用wsdl2java实用程序创建一个Web服务客户端。 我必须通过SSL连接到此服务器 这个wsdl看起来像这样: https://xxx.xx.xx.xx:8443/api/wsdl/xxxxxxx.wsdl 我使用以下方法生成证书: openssl s_client -connect xxx.xx.xx.x:8443 abcCertificate.pem 并使用以下命令将其添加到密钥库: keytool -import -noprompt -trustcacerts -alias testcert -file abcCertificate.pem -keystore /usr/java/jdk1.7.0_06/jre/lib/security/cacerts -ext san=ip:xxx.xx.xx.xx 当我尝试使用wsdl2java创建Web服务客户端时,它会抛出exception : javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present 我使用此链接中的这些信息。

无法初始化类javax.crypto.SunJCE_b

我开发了一个Java servlet应用程序,在我开发的PC上,一切都按预期工作,包括使用SFTP以编程方式在端口8443等上使用HTTPS复制PDF并使用SSL证书。 但是,当我尝试在Live服务器上运行应用程序时,我收到错误; java.lang.NoClassDefFoundError:无法初始化类javax.crypto.SunJCE_b 在调查中,有人建议检查jce.jar。 但我确保jce.jar存在,并在我的项目中创建了一个“lib”文件夹,并将jar复制到那里并将jar放在我的构建路径上,但问题仍然存在。 我该如何解决这个问题? 提前致谢。 这是Tomcat启动应用程序后的控制台输出; # 08-Jan-2014 10:45:44 org.apache.catalina.startup.Catalina start INFO: Server startup in 12715 ms 08-Jan-2014 10:47:42 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor run SEVERE: java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.SunJCE_b at javax.crypto.Cipher.getInstance(DashoA13*..) at com.sun.net.ssl.internal.ssl.JsseJce.getCipher(Unknown Source) at com.sun.net.ssl.internal.ssl.RSAClientKeyExchange.(Unknown Source) at com.sun.net.ssl.internal.ssl.ServerHandshaker.processMessage(Unknown Source) at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source) at com.sun.net.ssl.internal.ssl.Handshaker$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.net.ssl.internal.ssl.Handshaker$DelegatedTask.run(Unknown Source) at […]

如何从密钥库导出.key和.crt

当我在开发机器上构建android应用程序时,我需要为应用程序提供SSL证书,因此我为Tomcat生成了一个带keytool的密钥库。 我从密钥库中提取了证书并将其放入.bks以使用android,一切顺利。 现在我们必须将所有服务器端代码转移到需要Apache HTTP和Tomcat的服务器上。 Apache HTTP SSL需要.key和.crt文件,我找不到从密钥库导出.key和.crt文件的方法 有人能帮忙吗? 我发现你可以从.pem生成.crt openssl x509 -outform der -in your-cert.pem -out your-cert.crt 但我怎么能得到.key文件?

java安全套接字没有认证?

我有一个简单的安全套接字服务器 – 客户端程序。 对于服务器证书,我使用keytool创建了一个密钥库。 当我尝试通过我的客户端连接到服务器时,我得到以下exception: 在服务器中: Exception in thread “main” javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown 在客户端: Exception in thread “main” javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source) 如果我的理解是正确的,那么这些例外是由于我使用我创建的证书这一事实引起的。 我的问题如下: 如果我在服务器和客户端中设置启用的密码套件,所有* _anon *密码套件,这不应该解决问题吗? 我的意思是如果我启用*_anon_*密码套件,则不需要身份validation,因此没有例外。 它是否正确? 因为我仍然有例外。 我尝试在启用的密码套件中启用所有已启用的+ _anon密码套件。 没有成功。 我尝试只设置anon并获得一个新例外: Exception in thread “main” […]

SSL Elasticsearch

我有一个es_client (java/dropwizard)应用程序。 它通过纯文本连接与弹性搜索进行通信。 我按照https://github.com/sonian/elasticsearch-jetty上的说明为es client设置了SSL。 但是,当我启动es_client它每5秒报告一次: INFO [2014-01-08 23:02:14,814] org.elasticsearch.client.transport: [Karolina Dean] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9443]], disconnecting… ! org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9443]][cluster/nodes/info] disconnected 我该如何解决这个问题呢? 谢谢,Maciej

Jenkins CI – SSL handshake_failure

我正在尝试配置Jenkins CI以执行我们项目的持续集成,并且无法通过https连接到我们的SVN存储库。 每当我尝试配置存储库URL并尝试连接时,我都会遇到以下exception: org.tmatesoft.svn.core.SVNException: svn: OPTIONS /svn/repo/path failed at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:291) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:276) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:264) at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:516) at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:98) at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1001) at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.testConnection(DAVRepository.java:97) at hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(SubversionSCM.java:1966) at hudson.scm.SubversionSCM$DescriptorImpl.doCheckRemote(SubversionSCM.java:1900) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) at […]

SSLHandshakeException:握手期间远程主机关闭连接

论坛充满了这个问题,但我找不到解决方案。 我尝试连接WS但没有任何成功。 我试图更新cacerts文件没有任何效果。 日志是: Allow unsafe renegotiation: false Allow legacy hello messages: true Is initial handshake: true Is secure renegotiation: false %% No cached client session *** ClientHello, TLSv1 RandomCookie: GMT: 1507108654 bytes = { 133, 135, 81, 148, 186, 186, 146, 23, 28, 240, 158, 152, 139, 167, 209, 225, 54, 253, 112, 118, […]