Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • r(603) - Invalid certificate

    Dear All,

    when copying data from Internet over https I am getting a specific error:

    Code:
    copy "https://some_internet_site/foo/bar" "my_local_temp_file"
    
    ssl handshake error
        javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
        unable to find valid certification path to requested target
    r(603);

    The error is not uncommon (see e.g. here) and indicates a problem establishing a secure connection.

    I do know that in this case (leaving out some details) indeed the connection is intercepted and the intruder is masking the intrusion by a self-signed certificate.

    I do want to separate this problem from other reasons the data can't be copied over the internet.

    When I do a capture - I get a code 603, but I believe this code covers all sorts of "File open errors".

    Is there any way to programmatically detect this particular situation, specifically (ssl handshake error)? Some sort of sub-code or last network error code?

    I tried -set netdebug on- as indicated in "Why can my browser reach sites on the web but Stata cannot?", but it didn't produce any additional output. The issue is not in the proxy server. Proxy server is not in play neither in the Stata nor in the browser interaction with the site.

    At this time the only option I seem to have is to (not exactly the runnable code, but you get the idea):

    Code:
    log using "something", text replace
    capture noisily copy "https://some_internet_site/foo/bar" "my_local_temp_file"
    log close
    // now parse the log file trying to recognize from text content whether this error has happened.
    which is something I'd much rather avoid.

    Thank you, Sergiy

    PS: I have a weird deja vu feeling that I have asked this question before already, but upon a search I couldn't find a reference. If so, please pardon me for asking again.
Working...
X