Replies: 22 comments 20 replies
-
Question, Im currently writing code to use the PemUtils, do the library get the password from the private key within the key.pem file and save it to keyPassword or do I have to create the variable and save the password to keyPassword manually. Speaking of line item 302 from PemUtils.class. |
Beta Was this translation helpful? Give feedback.
-
here is the code /** |
Beta Was this translation helpful? Give feedback.
-
Yes, now it is clear! The library does not get the password from the pem file itself. You should provided it. You should create a variable indeed, similar to this unit test here Here is an encrypted pem file is being used and a separate password is provided. |
Beta Was this translation helpful? Give feedback.
-
Question, I have 3 pem files, ca.pem, privatkey.pem an publicert.pem; currently viewing the PemUtils.java file trying to decide which code snippet to use. Can I use this one to get material needed, or do I need to use the code snippet for each pem file type from PemUtils.java. private static X509ExtendedKeyManager parseIdentityMaterial(Certificate[] certificatesChain, PrivateKey privateKey) {
|
Beta Was this translation helpful? Give feedback.
-
Pertaining to PemUtils I keep getting error message for the below code I used certificatePaths as the variable to hold the actual filesystem path for the dev.pem certificate. I get error: cannot find symbol loadCertificate(certificatePaths). Where is the method loadCertificate or do I have the path incorrect .......................................... ^ public static X509ExtendedTrustManager loadTrustMaterial(Path certificatePaths) { |
Beta Was this translation helpful? Give feedback.
-
The PemUtils is only used as a library correct, because I created a PemUtils.java in my application but I also see it inside the kickstart-for-pem library. So Im assuming I dont need to use the PemUtils directly. Let me know if I'm on the right track. |
Beta Was this translation helpful? Give feedback.
-
I have written a class titled PemService.java, I have written code within the class to return keyManager and another to return trustManager but I dont know how to get the return keyManager and trustManager to an api in springboot. I tried looking for examples but all I see using the default springboot that is setup using apppplication.yml. Im using the sslcontext-kickstart-for pem. Here are the files I created.
} |
Beta Was this translation helpful? Give feedback.
-
That is the reason that I'm using Jetty server, I excluded Tomcat server. I don't know how to use spring boot to get the keyManager and trustManager from the code example PemService.java I sent you. If you have a example api that obtains the keyManager and trustManager materials and open an ssl connection using the PemService.java I sent to you would be great. |
Beta Was this translation helpful? Give feedback.
-
Im getting an error when I run the application it gradle builds with no issues but once running the application I get this error: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnstatisfiedDependencyException: Error creating bean with name 'webServerFactory' defined in class path resource [com/citi/sddc/api/config/ServerConfig.class]: Unsatisfied dependency expressed through met hod 'webServerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sslContextFactory' defined in class path resource [com/citi/sddc/api/config/ServerConfig.class]: Unsatisfied dependency expressed through method 'sslContextFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sslFactory' defined in class path resource [com/citi/sddc/api/config/ServerConfig.class] |
Beta Was this translation helpful? Give feedback.
-
Caused by: nl.altindag.ssl.exception.GenericIOException: java.lang.IllegalArgumentException: No valid InputStream has been provided. InputStream must be present, but was absent. |
Beta Was this translation helpful? Give feedback.
-
Are you speaking of the actual pem files |
Beta Was this translation helpful? Give feedback.
-
I added this to the ServerConfig.java class trying to make sure the pem files are being accessed: private static final String PEM_LOCATION = "src/main/resources";
|
Beta Was this translation helpful? Give feedback.
-
Also I'm using version 7.0.3 of sslcontext-kickstart-7.3.0 and version 7.2.0 of sslcontext-kickstart-for-jetty. Would that make a difference. |
Beta Was this translation helpful? Give feedback.
-
Here is the exception Im getting now that I removed the prefix: "src/main/resources" Factory method 'sslFactory' threw exception; nested exception is nl.altindag.ssl.exception.PrivateKeyParseException: org.bouncycastle.openssl.PEMException: exception processing key pair: JCE cannot authenticate the provider BC. |
Beta Was this translation helpful? Give feedback.
-
Sounds like I may have a bad password must be a way to check it. |
Beta Was this translation helpful? Give feedback.
-
I double checked the password using command prompt "openssl rsa -in src/main/resources/devkey.pem then put in the password I have and it worked so I know its not the password. But the password is encrypted will that make a difference. |
Beta Was this translation helpful? Give feedback.
-
found the problem I was using Bouncycastle lib outside of your library, no longer receiving error now I have to fix the actual rest call since it is a secure call. |
Beta Was this translation helpful? Give feedback.
-
Its working now, question can I use the sslcontext-kickstart to update certificate without restarting server. |
Beta Was this translation helpful? Give feedback.
-
Should I create a new java class for it or put it within the ServerConfig.java class |
Beta Was this translation helpful? Give feedback.
-
Thank you for all your help, I will add it to the ServerConfig.java file. |
Beta Was this translation helpful? Give feedback.
-
Question in (SSLFactory baseSslFactory = SSLFactory.builder() |
Beta Was this translation helpful? Give feedback.
-
Question, do you have any information on getting the CN common name and OU organizational unit from certificate to allow access. |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions