Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8339347

keytool -importpass insists prompting the user even if there is no terminal

    XMLWordPrintable

Details

    Description

      There is a behavior change in keytool somewhere between JDK 8 and JDK 22.

      This keytool command used to work in order to build a p12 file but now it’s attempting to prompt in JDK 22; is there a new flag to use instead?

      echo "<CLIENT_SECRET>" | keytool -importpass -storetype pkcs12 -alias "<CLIENT_ID>" -keystore "test.p12" -storepass "<store pass>"

      Example:
      echo "2222" | keytool -importpass -storetype pkcs12 -alias "1111" -keystore "test.p12" -storepass "mypass"
      Enter the password to be stored: Re-enter password: They don't match. Try again
      Enter the password to be stored: Re-enter password:

      When run in JDK 8

      Example:

      echo "2222" | /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home/bin/keytool -importpass -storetype pkcs12 -alias "1111" -keystore "test.p12" -storepass "mypass"

      No output file is just created properly

      Attachments

        Issue Links

          Activity

            People

              hchao Haimay Chao
              weijun Weijun Wang
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: