Giter Site home page Giter Site logo

Comments (7)

Hakky54 avatar Hakky54 commented on September 13, 2024

Hi @manbucy

Thank you for the very detailed issue description. It is very helpful when investigating this issue, I really appreciate it!
I have tried this out locally and for me this issue is not happening, see below for the screenshot:

Screenshot 2022-04-09 at 17 22 40

As you can see one certificate is loaded and also visible within the trustmanager of the sslcontext.
I think this issue is caused by CertificateUtils not being able to find the certificate on your classpath, but to be sure I need to ask if you can retry something on your side. Can you put the statement of CertificateUtils on a separate line and check whether the list is empty or has elements? So basically the following snippet:

List<Certificate> certificates = CertificateUtils.loadCertificate("ca.crt");

SSLFactory sslFactory = SSLFactory.builder()
        .withTrustMaterial(certificates)
        .build();

from sslcontext-kickstart.

manbucy avatar manbucy commented on September 13, 2024

@Hakky54 Thank you for your reply, i have put the statement of CertificateUtils on a separate line, but the trustedCerts is still emply.
image

but when i use jdk11, I found the sslcontext become correct.
sun.security.pkcs12.PKCS12KeyStore.setCertEntry(String alias, Certificate cert, Set<Attribute> attributes)
image
image

from sslcontext-kickstart.

manbucy avatar manbucy commented on September 13, 2024

JDK-10+0 and previous versions are entries.put(alias, certEntry); source code

JDK-10+1 and later versions are entries.put(alias.toLowerCase(Locale.ENGLISH), certEntry); source code

from sslcontext-kickstart.

Hakky54 avatar Hakky54 commented on September 13, 2024

I tried jdk 1.8.0_302 which did not have this issue. I currently don't have my dev environment next to me, so i will come back to you in 4 hours and try out with jdk 1.8.0_202 locally

from sslcontext-kickstart.

Hakky54 avatar Hakky54 commented on September 13, 2024

I have retried it with jdk 1.8.0_202 and indeed that issue is present over there and your PR changes fixes it. Very well investigated! I am amazed for your detailed research. Thank you very much for this issue and pull request. I have approved the PR and merged it.

Just out of curiosity, why are you using jdk 1.8.0_202 and not using the latest version of jdk 1.8?

from sslcontext-kickstart.

manbucy avatar manbucy commented on September 13, 2024

Just out of curiosity, why are you using jdk 1.8.0_202 and not using the latest version of jdk 1.8?

This JDK1.8.0_202 was installed in 2019 when it was the latest version and I haven't updated it since. Jdk1.8.0_202, on the other hand, is the last OTN License release that many companies will choose.

from sslcontext-kickstart.

Hakky54 avatar Hakky54 commented on September 13, 2024

Yes, very understandable and I didn't know about the OTN license!
I have just released your fix which is now available at version 7.4.1. Good luck, please let me know if you have any other improvements πŸ˜„

from sslcontext-kickstart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.