B4J Question [SOLVED] SSL and keystore password error

Discussion in 'B4J Questions' started by magi6162, Mar 2, 2018.

  1. magi6162

    magi6162 Well-Known Member Licensed User

    my web app (ABM) on server (GCE) ubuntu 17.10
    Run web app, with: sudo nohup java -jar myapp.jar > nohup.out &

    nohup.out:
     
  2. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    How did you create the certificate?
     
    magi6162 likes this.
  3. magi6162

    magi6162 Well-Known Member Licensed User

  4. magi6162

    magi6162 Well-Known Member Licensed User

    Some doubts come to me for password management, here:
    Code:
    Private Sub ConfigureSSL (SslPort As Int)
        
    'example of SSL connector configuration
        Dim ssl As SslConfiguration
        ssl.Initialize
        ssl.SetKeyStorePath(
    File.DirApp & "/cert""mysite.keystore"'path to keystore file
        ssl.KeyStorePassword = "123456789"
        ssl.KeyManagerPassword = 
    "987654321"
        srvr.SetSslConfiguration(ssl, SslPort)
        
    'add filter to redirect all traffic from http to https (optional)
        srvr.AddFilter("/*""HttpsFilter"False)
    End Sub
    I'm not sure I entered the right password.
     
    Last edited: Mar 2, 2018
  5. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    I also have my SSL certificate from 1&1. Do you have a unmanaged?
     
    magi6162 likes this.
  6. magi6162

    magi6162 Well-Known Member Licensed User

    Last edited: Mar 2, 2018
  7. magi6162

    magi6162 Well-Known Member Licensed User

  8. magi6162

    magi6162 Well-Known Member Licensed User

    ssl.KeyStorePassword = "123456789" <<< password used in #6
    ssl.KeyManagerPassword = "987654321" <<< password used in #7

    correct?
     
  9. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    use this:
    "Loading Keys and Certificates via PKCS12"

    Code:
    openssl pkcs12 -inkey jetty.key -in jetty.crt -export -out jetty.pkcs12

    keytool -importkeystore -srckeystore jetty.pkcs12 -srcstoretype PKCS12 -destkeystore keystore[/SIZE]

    "jetty.key" is your private key and "jetty.crt" is the .cer file.
     
    magi6162 likes this.
  10. magi6162

    magi6162 Well-Known Member Licensed User

  11. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    not the "INTERMEDIATE" file, the other .cer.
     
    magi6162 likes this.
  12. magi6162

    magi6162 Well-Known Member Licensed User

    ok i'll try, thanks. then I will let you know
     
  13. magi6162

    magi6162 Well-Known Member Licensed User

    Is that OK?
     
  14. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    if it works, then yes.
     
    magi6162 likes this.
  15. magi6162

    magi6162 Well-Known Member Licensed User

    nothing!!

    ServerPort 51045
    SSL port 443
    run web app with: sudo nohup java -jar myapp.jar > nohup.out

    Code:
    Private Sub ConfigureSSL (SslPort As Int)
        
    'example of SSL connector configuration
        Dim ssl As SslConfiguration
        ssl.Initialize
        ssl.SetKeyStorePath(
    File.DirApp & "/cert""mysite.it.keystore"'path to keystore file
        ssl.KeyStorePassword = "123456789"
        ssl.KeyManagerPassword = 
    "987654321"
        srvr.SetSslConfiguration(ssl, SslPort)
        
    'add filter to redirect all traffic from http to https (optional)
        srvr.AddFilter("/*""HttpsFilter"False)
    End Sub
    nohup.out:
    help me, please.
    Now I do not understand anything anymore:confused:
     
    Last edited: Mar 2, 2018
  16. OliverA

    OliverA Expert Licensed User

    Where did you execute this command? What directory where you in?
     
    magi6162 likes this.
  17. OliverA

    OliverA Expert Licensed User

    You are using two different keystores. Are you sure you are not mixing them up?
     
    magi6162 likes this.
  18. magi6162

    magi6162 Well-Known Member Licensed User

    no, the first rename second.
     
  19. magi6162

    magi6162 Well-Known Member Licensed User

    in:
    magi6162@web-server-mysite:~/cert$
     
  20. OliverA

    OliverA Expert Licensed User

    Flip the passwords
     
    magi6162 likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice