Skocz do zawartości

pldenity

Użytkownicy
  • Zawartość

    2
  • Rejestracja

  • Ostatnio

Posty napisane przez pldenity


  1. Opiszę cały proces tak, żebym sam miał jasność, jak i inni.

     

    Mam wygenerowany plik keystore.jks z aliasem s1as, na podstawie tego wygenerowany keystore.csr, który został walidowany na stronie:

    secure.qualityssl.com

     

    Do ściągnięcia mam:

     

    AddTrustExternalCARoot.crt
    RSAAddTrustCA.crt
    RSADomainValidationSecureServerCA.crt
    mojadomena.crt

     

     

    Na czystym keystorze listuję co w nim jest:

    C:\Program Files\Java\jre1.8.0_151\bin>keytool -list -keystore keystore.jks
    Enter keystore password:
    Keystore type: JKS
    Keystore provider: SUN
    
    
    Your keystore contains 1 entry
    
    
    s1as, 2018-02-27, PrivateKeyEntry,
    Certificate fingerprint (SHA1): F2:5A:9B:48:3D:DB:45:1D:0A:61:B8:CF:96:5A:70:56:76:F7:45:F7
    
    
    C:\Program Files\Java\jre1.8.0_151\bin>

    i teraz niby przy pomocy instrukcji robię:

    Step 2: Install the certificate files on your Java Based Web Server

    Use the keytool command to import the Intermediate Root Certificates as follows:

    • Use the following command to import the AddTrustExternalCARoot Certificate:

      keytool -import -trustcacerts -alias root -file AddTrustExternalCARoot.crt -keystore keystore.jks

    • You will be asked for a Password. You should enter the same password that you used during the CSR generation for your crm.comtronic.pl certificate
    • Next, you will see information about the AddTrustExternalCARoot certificate and you will be asked if you want to trust the AddTrustExternalCARoot certificate. Type y or yes.
    • You should then see an information message that says: "Certificate was added to keystore"
    • Use the same procedure to import the RSAAddTrustCA Certificate using the keytool command:

      keytool -import -trustcacerts -alias qualityssl -file RSAAddTrustCA.crt -keystore keystore.jks

    • and the RSAAddTrustCA Certificate using the keytool command:

      keytool -import -trustcacerts -alias qualityssl -file RSAAddTrustCA.crt -keystore keystore.jks

    • Now use the same procedure to import your Certificate (mojadomena.crt) using the keytool command:

      keytool -import -trustcacerts -file crm.comtronic.pl.crt -keystore keystore.jks

    You are now all set to test your certificate by using a browser to connect to your crm.comtronic.pl site. Use the https protocol directive (e.g. https://) to indicate that you wish to use secure HTTP.

     

     

    Z tym, że domyślam się, że niewymieniony, a powtórzony po nazwie plik, trzeba zamienić, więc robię to tak:

     

    keytool -import -trustcacerts -alias qualityssl-sec -file RSADomainValidationSecureServerCA.crt -keystore keystore.jks

     

    No i to nie działa, korzystałem z wielu instrukcji.

     

    A korzystając z tej instrukcji:

     

     

     

    1. To install the SSL Certificate file to your keystore, type the following command:

      keytool -import -trustcacerts -alias server -file your_site_name.p7b -keystore your_site_name.jks

    2. You should get a confirmation stating that the "Certificate reply was installed in keystore."

    3. If asked if you want to trust the certificate, choose y or yes.

    4. Your keystore file (your_site_name.jks) is now ready to be used on your Tomcat Server. Now, you need to configure your server to use it.

     

    To nawet jak wyeksportuję certyfikat na p7b, korzystając z Keystore explorer, to próbując załadować plik mojadomena.p7b dostaję zwrotkę:

     

    C:\Program Files\Java\jre1.8.0_151\bin>keytool -import -trustcacerts -alias s1as -file crm.comtronic.pl.p7b -keystore keystore.jks
    Enter keystore password:
    keytool error: java.lang.Exception: Certificate not imported, alias <s1as> already exists

    AKTUALIZACJA

     

    Po wydaniu polecenia:

    keytool -importcert -trustcacerts -alias s1as -file mojadomena.crt -keystore keystore.jks

    efekt jest taki, że certyfikat jest widoczny jako podpisany, ale strona widoczna jako niezabezpieczona:

     

    post-49523-0-63698500-1519913276_thumb.png

     

    Zapewne chodzi o certyfikat root i certyfikaty pośrednie, ale wgrywam je modyfikując w keytool

    -import i / -importcert i efekt nadal taki jaki widać.


  2. Panowie męczę się z certyfikatami, już bardzo długo, przejrzałem cały internet. Chodzi o to, że generuję plik keystore.jks i na jego podstawie plik.csr, żeby przeprowadzić walidację domeny. Walidacja przechodzi pomyślnie i dostaję na maila paczkę plików:

    AddTrustExternalCARoot.crt
    RSAAddTrustCA.crt
    RSADomainValidationSecureServerCA.crt
    mojadomena.crt

    zarówno w glassfishu i w tomcat mam mieć zainstalowany certyfikat, ale mam ten plik keystore.jks przez siebie wygenerowany i w nim chyba jest klucz prywatny, który sam ustaliłem, w jaki sposób te certyfikat zainstalować poprawnie, czy mam usunąć ten klucz prywatny z aliasem w keystorze i na jego miejsce dać mojadomena.crt z takim samym aliasem czy nie ? Czy resztę certyfikatów wrzucić do keystore.jks z domyślnym aliasem czy nie ? Robię to według różnych tutoriali, ale cały czas po ssl jest info, że cert nieprawidłowy.

     

×