Troubleshooting Security

To monitor security access, you can set the java.security.debug system property, which determines what trace messages are printed during execution. To view security properties, security providers, and TLS-related settings, specify the -XshowSettings:security option in the java command.

To see a list of all debugging options, use the help option as follows. MyApp is any Java application. The java command prints the debugging options and then exits before running MyApp.

java -Djava.security.debug=help MyApp

Note:

The following table lists java.security.debug options and links to further information about each option:

Option Description Further Information
all Turn on all debugging None
access

Print all results from the AccessController.checkPermission method.

You can use the following options with the access option:

  1. stack: Include stack trace
  2. domain: Dump all domains in context
  3. failure: Before throwing exception, dump stack and domain that do not have permission

You can use the following options with the stack and domain options:

  1. permission=<classname>: Only dump output if specified permission is being checked
  2. codebase=<URL>: Only dump output if specified codebase is being checked
certpath Turns on debugging for the PKIX CertPathValidator and CertPathBuilder implementations.

You can use the following options with the certpath option:

  • ocsp: Dump OCSP protocol exchanges. A hexadecimal dump of the OCSP request and response bytes is displayed.
  • verbose: Print additional debugging information
combiner SubjectDomainCombiner debugging
configfile JAAS (Java Authentication and Authorization Service) configuration file loading
configparser JAAS configuration file parsing
gssloginconfig Java GSS (Generic Security Services) login configuration file debugging
jar JAR file verification

Note: Use the System property jdk.jar.maxSignatureFileSize to specify the maximum size, in bytes, of signature files in a signed JAR. Its default value is 16000000 (16 MB).

jca JCA engine class debugging
keystore Keystore debugging
logincontext LoginContext results
pcsc Java Smart Card I/O and SunPCSC provider debugging
pkcs11 PKCS11 session manager debugging
pkcs11keystore PKCS11 KeyStore debugging
pkcs12 PKCS12 KeyStore debugging None
policy Loading and granting permissions with policy file
properties java.security configuration file debugging None
provider Security provider debugging

You can use the engine=<engines> option with the provider option: The output is displayed only for a specified list of JCA engines. The supported values for <engines> are:

  • Cipher
  • KeyAgreement
  • KeyGenerator
  • KeyPairGenerator
  • KeyStore
  • Mac
  • MessageDigest
  • SecureRandom
  • Signature
scl Permissions SecureClassLoader assigns
sunpkcs11 SunPKCS11 provider debugging
ts Timestamping debugging None
x509 X.509 certificate debugging

The java -XshowSettings:security Option

You can specify the option -XshowSettings:security option in the java command to view security properties, security providers, and TLS-related settings. The option shows third-party security provider details if they are included in the application class path and such providers are configured in the java.security file.

In addition, you can specify -XshowSettings:security:<subcategory> where <subcategory> is one of the following:


Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved.