JVR (Community Member) asked a question.

Error after input Srcclr Activate in command line

When i input the srcclr activate command after install srcclr and the Authentication Token, the system shows an error:

Unable to communicate with SourceClear API: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

 

Somebody could help me with this?.

Thanks!!.


  • pmcneil (Veracode, Inc.)

    @JVR you'll see this error when the agent cannot establish a TLS connection to the Veracode platform. It's fairly typical that the root cause for this is either a) some kind of outbound filtering on your network, or b) there is some TLS inspection / proxying going on for your connection. The inspection could be occurring as part of a transparent proxy or as an explicit proxy that you need to use.

     

    To diagnose the connection you can use some Java debugging options.

     

    For Linux/MacOS just use the following command before doing the activate: "export JAVA_OPTS=-Djavax.net.debug=ssl,handshake"

     

    For Windows, add a User environment variable with the same values:

    env-var

    The output will show the TLS messages and the certificates involved in the process and should highlight where the connection breaks down. The 'normal' interaction as of today's date should show Amazon and Starfield certificates. If you see one from a different Certificate Authority then it's likely there is TLS inspection / proxy setup.

     

    You will need to get the CA cert for your proxy from your IT team and set:

     

    Windows Powershell:

    $Env:SRCCLR_SSL_CERT_DIR='C:\<a directory with the cert>'

    $Env:http_proxy=http://<proxyip>:<proxyport>

     

    Linux / MacOS:

    export SRCCLR_SSL_CERT_DIR=/<a directory with the cert>

    export http_proxy=http://<proxyip>:<proxyport>

     

    If you cannot find the appropriate IT person to give you the cert, you can also attempt to capture all the certs in the chain.

     

    CertChainWriter

    In a directory where you can compile some code… like C:\temp …

    Either git clone or download the zip from https://github.com/ctcampbell/certchainwriter and unzip it.

    In the directory where the CertChainWriter code is located…

     

    Javac *.java

    Jar cvfe CertChainWriter.jar CertChainWriter *.class

    Java -Dhttps.proxyHost=<proxy hostname> -Dhttps.proxyPort=<port #> -jar CertChainWriter.jar api.sourceclear.com 443

     

    A bunch of certs will be created in that directory. You can copy/move them to a ‘known’ directory that contains certs and re-try your activation!

     

    After you're done, clean up your JAVA_OPTS by removing that value or you're going to have a pretty noisy environment...

    Expand Post

Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.