keystore

Configuration issue for Spray https server with self-signed certificate?

帅比萌擦擦* 提交于 2019-12-03 07:48:55
I am using Spray 1.3, Akka 2.3, and Scala 2.11 on Mac 10.9.4 to set up an HTTP server. I am following the Ch. 2 example in Manning's Akka in Action (sample code available here: https://github.com/RayRoestenburg/akka-in-action.git ), which compiles, runs, and behaves as expected when I use http, but I am having trouble configuring it for use with https. To run with https, I have generated a self-signed certificate as follows: keytool -genkey -keyalg RSA -alias selfsigned -keystore myjks.jks -storepass abcdef -validity 360 -keysize 2048 Following this example, https://github.com/spray/spray/tree

How to generate keystore and truststore

允我心安 提交于 2019-12-03 07:34:42
问题 How to: Generate keystore Generate truststore To make SSL work between client and server, I need help in only Generation of keystore and truststore for mutual authentication step-by-step guide with terminal commands(Keytool and openssl). 回答1: I followed This link. 1.Generate keystore(At server): keytool -genkey -alias bmc -keyalg RSA -keystore KeyStore.jks -keysize 2048 2.Generate new ca-cert and ca-key: openssl req -new -x509 -keyout ca-key -out ca-cert 3.Extracting cert/creating cert sign

Hide datasource password in spring xml file

你离开我真会死。 提交于 2019-12-03 07:25:10
问题 there is a way to hide/encrypt password in xml spring config file? I read that is possible with a "custom" subclass of DataSource, but the solutions keep key in same config file as plain text...so is a bit useless. There is a way to use KeyStore for this? For example read the value from a keystore. Thanks all. 回答1: Yes, you can do that. You will have to create a wrapper bean around the data source class. Here is an example of how I have done it before. Hope this helps! <beans> <bean id=

Sun Java KeyManagerFactory and null passwords

你。 提交于 2019-12-03 07:19:06
We are having a problem with the KeyManagerFactory in the Sun JRE 1.6. We are using code similar to the following to upload and use a certificate in p12 format: KeyStore keyStore = KeyStore.getInstance(PKCS12); KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(SUN_X509); InputStream certificateFile = getSSLCertificate(); String certificatePassword = getSSLCertificatePassword(); keyStore.load(certificateFile, certificatePassword); keyManagerFactory.init(keyStore, certificatePassword); This code works correctly when the certificate password exists. But when the certificate

Java 7 (acting as client) SSL handshake failure with keystore and truststore that worked in Java 6

懵懂的女人 提交于 2019-12-03 07:17:49
I'm doing a JBoss AS 5.1 to 7.4, and Java 6 to 7 migration, and get a handshake failure. The keystore and truststore are the ones we have been using successfully for ages with Java 6. I've written some tests to narrow the problem down, it's definitely not JBoss but rather Java 7. With SSL logging turned on, I get this: 17:44:30,041 INFO [stdout] (http-/192.168.147.20:8080-120) %% Invalidated: [Session-2, SSL_RSA_WITH_RC4_128_SHA] 17:44:30,041 INFO [stdout] (http-/192.168.147.20:8080-120) http-/192.168.147.20:8080-120, SEND TLSv1 ALERT: fatal, description = certificate_unknown 17:44:30,041 INFO

Does android support .jks keystore type?

…衆ロ難τιáo~ 提交于 2019-12-03 07:09:53
问题 I am trying to connect to server using keystore which is provided by server team. While sending service call to server first i created KeyStore Instance by using following api KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); It’s returning the keystore type as “BKS”. The Keystore what server team sent is of type “.jks”(somename.jks) So, I am getting exception “Wrong version of key store”. I tried by passing “JKS” to getInstance() of KeyStore by following way KeyStore

Enabling HTTPS in Undertow

痞子三分冷 提交于 2019-12-03 06:25:42
问题 We have a working Apache mod_ssl configuration. I want to enable HTTPS support for Undertow, so that it listens for both http and https, thus obviating the need for Apache. I've looked into Undertow's javadocs. The Undertow.Builder class has two addHttpsListener methods with the following signatures: public Builder addHttpsListener(int port, String host, KeyManager[] keyManagers, TrustManager[] trustManagers); public Builder addHttpsListener(int port, String host, SSLContext sslContext) { So

Import StartCom CA certificates in Windows JRE

我与影子孤独终老i 提交于 2019-12-03 06:01:00
问题 I have a Java application accessing a service that uses a StartCom SSL certificate. For this to work, I need to add the StartCom CA certs to Java's truststore, because they're not in there by default yet. I've succesfully done that on linux using these commands sudo keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -noprompt -alias startcom.ca -file ca.crt sudo keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass

Read public key from file in keystore

女生的网名这么多〃 提交于 2019-12-03 05:08:39
问题 Hi I want to extract public key from KeyStore using Java code I am creating a keystore keytool -genkey -alias mykeystore -keyalg RSA -keystore mykeystore.jks -keysize 2048 And exporting the public into another file keytool -export -alias mykeystore -keystore mykeystore.jks -rfc -file publickey.cert How can I get the Public Key String from keystore or the publickey.cert file using the Java code? Thanks. UPDATE public static void main(String[] args) { try { FileInputStream is = new

cannot connect to server using BKS keystore

谁说我不能喝 提交于 2019-12-03 03:51:11
I my android application am using SSL for client authentication and I am using BKS format keystore and MyHttpClient class looks as below, public class MyHttpClient extends DefaultHttpClient { final Context context; public MyHttpClient(Context context) { this.context = context; } @Override protected ClientConnectionManager createClientConnectionManager() { SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); // Register for port 443 our SSLSocketFactory with our keystore // to the ConnectionManager registry.register