I/o Error Reading Keystore/truststore File Invalid Keystore Format
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta keytool storetype Discuss the workings and policies of this site About Us Learn
Keytool Error: Java.io.ioexception: Derinputstream.getlength(): Lengthtag=109, Too Big.
more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack convert p12 to jks Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you,
Toderinputstream Rejects Tag Type 45
helping each other. Join them; it only takes a minute: Sign up KeyStore, HttpClient, and HTTPS: Can someone explain this code to me? up vote 2 down vote favorite I'm trying to understand what's going on in this code. KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream instream = new FileInputStream(new File("my.keystore")); try { trustStore.load(instream, "nopassword".toCharArray()); } finally { instream.close(); keytool create keystore } SSLSocketFactory socketFactory = new SSLSocketFactory(trustStore); Scheme sch = new Scheme("https", socketFactory, 443); httpclient.getConnectionManager().getSchemeRegistry().register(sch); My Questions: trustStore.load(instream, "nopassword".toCharArray()); is doing what exactly? From reading the documentation load() will load KeyStore data from an input stream (which is just an empty file we just created), using some arbitrary "nopassword". Why not just load it with null as the InputStream parameter and an empty string as the password field? And then what is happening when this empty KeyStore is being passed to the SSLSocketFactory constructor? What's the result of such an operation? Or -- is this simply an example where in a real application you would have to actually put a reference to an existing keystore file / password? java https httpclient keystore share|improve this question asked Apr 29 '10 at 23:44 stormin986 4,644133049 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Or -- is this simply an example where in a real application you would have to actually put a reference to an
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business
Keytool List
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Java Keytool
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just java keystore like you, helping each other. Join them; it only takes a minute: Sign up Invalid Keystore Format after creating a keystore and attaching a certificate to it up vote 2 down vote favorite 1 I am creating http://stackoverflow.com/questions/2741457/keystore-httpclient-and-https-can-someone-explain-this-code-to-me a keystore using OpenSSL using the following command : openssl pkcs12 -export -in mycert.crt -inkey mykey.key \ -out mycert.p12 -name tomcat -CAfile myCA.crt \ -caname root as per the documentation. Now when I try to validate the keystore using keytool -list -v -keystore mycert.p12, I am getting an Invalid Keystore Exception. Is this because I am using Apache implementation of creating a keystore? Also a constraint I have is that I cannot use Java keytool http://stackoverflow.com/questions/10980088/invalid-keystore-format-after-creating-a-keystore-and-attaching-a-certificate-to to create a keystore although my Java program is using to keystore for FTPS transfer. java openssl share|improve this question edited May 5 '14 at 18:21 ArtB 7,1881563104 asked Jun 11 '12 at 12:25 justin3250 1031618 add a comment| 1 Answer 1 active oldest votes up vote 10 down vote accepted Use -storetype pkcs12 option with keytool. keytool -list -v -keystore mycert.p12 -storetype pkcs12 By default, keytool assumes that the keystore type is JKS and if it's not, keytool fails. If using other keystore files (.p12 in your example), you need to explicitely give a store type using the mentioned method. share|improve this answer edited Jun 11 '12 at 13:53 answered Jun 11 '12 at 13:24 npe 10.1k12845 Yes Thank you this works although the command will be keytool -list -v -keystore mycert.p12 -storetype pkcs12 .Note '=' has to be removed.Thank you very much npe –justin3250 Jun 11 '12 at 13:51 Corrected. Glad I could help :-) –npe Jun 11 '12 at 13:53 Thanks. In addition, I had to specify -storepass
Data Ingestion https://svn.apache.org/repos/asf/httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java & Streaming Data Processing Design & Architecture Governance & Lifecycle Hadoop Core Sandbox i/o error & Learning Security Solutions All Tags All Questions All Ideas All Repos All Articles All Users All Badges Leaderboard Login Home / Security / 1 i/o error reading Question by Prakash Punj · Feb 17 at 09:52 PM · Hivesecurity Invalid keystore format while opening a HIVE view - After enabling SSL and setting up a trust keystore. org.apache.ambari.view.utils.ambari.AmbariApiException: RA040 I/O error while requesting Ambari org.apache.ambari.view.utils.ambari.AmbariApiException: RA040 I/O error while requesting Ambari at org.apache.ambari.view.utils.ambari.AmbariApi.requestClusterAPI(AmbariApi.java:176) at org.apache.ambari.view.utils.ambari.AmbariApi.requestClusterAPI(AmbariApi.java:142) at org.apache.ambari.view.utils.ambari.AmbariApi.getHostsWithComponent(AmbariApi.java:99) at org.apache.ambari.view.hive.client.ConnectionFactory.getHiveHost(ConnectionFactory.java:79) at org.apache.ambari.view.hive.client.ConnectionFactory.create(ConnectionFactory.java:68) at org.apache.ambari.view.hive.client.UserLocalConnection.initialValue(UserLocalConnection.java:42) at org.apache.ambari.view.hive.client.UserLocalConnection.initialValue(UserLocalConnection.java:26) at org.apache.ambari.view.utils.UserLocal.get(UserLocal.java:66) at org.apache.ambari.view.hive.resources.browser.HiveBrowserService.databases(HiveBrowserService.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java