Announcement

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

  • "PKIX path building failed" error message

    Hi all,

    I'm trying to import a file directly from the internet and I keep getting the following error:

    PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
    The webpage is the following: https://www.economia.gob.ar/dnap/recursos.html
    although the file is not directly downloaded from there
    and the URL of the file I would like to import to Stata is the following: https://www.economia.gob.ar/dnap/rec...net_diario.xls
    This URL directly downloads an excel file once you type it in the internet browser.
    But when I run the following line:

    Code:
    insheet using "https://www.economia.gob.ar/dnap/recursos/ron/montos_diarios/2021/enero2021/internet_diario.xls"
    or

    Code:
    import excel using "https://www.economia.gob.ar/dnap/recursos/ron/montos_diarios/2021/enero2021/internet_diario.xls"
    or

    Code:
    tempfile prueba 
    copy "https://www.economia.gob.ar/dnap/recursos/ron/montos_diarios/2021/enero2021/internet_diario.xls" "Prueba.xls"
    I always get the same error that I cited above. Does anyone know what could be the problem and how to solve it?
    Thanks!

  • #2
    It looks like the certificate chain at www.economia.gob.ar is misconfigured. www.ssllabs.com/ssltest/analyze.html?d=www.economia.gob.ar reports "Chain issues; incomplete extra certs" on that site. While browsers will sometimes fill in gaps in the certificate chain, Stata will not. If possible you might want to contact the site and let them know there is an issue. In the meantime, you can download the file using a web browser.

    Alternatively you can disable ssl certificate authentication in Stata.
    Code:
    . set sslrelax on
    
    Using set sslrelax on disables SSL certificate authentication.
    THIS SETTING SHOULD BE USED WITH EXTREME CAUTION.
    Please note the associated warning.

    Comment


    • #3
      I am getting the same error at a different website.

      Code:
      . import delim using "https://covid.ourworldindata.org/data/owid-covid-data.csv"
      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
      could not open url
      r(603);
      Following James, I tried https://www.ssllabs.com/ssltest/anal...orldindata.org, which does not report any chain issues.

      Comment


      • #4
        The command you posted works for me on multiple versions of Stata (13-17).
        Code:
        . import delim using "https://covid.ourworldindata.org/data/owid-covid-data.csv"
        (encoding automatically selected: ISO-8859-1)
        (67 vars, 149,028 obs)
        Make sure your Stata version is up to date. Also, I seem to recall that a misconfigured proxy server can cause this type of problem too. If you are connecting through a proxy server then you might touch base with whoever administers it.

        Comment


        • #5
          Thanks so much, James. I think it must be my employer's VPN/proxy server then.

          Comment


          • #6
            Hello All.
            I am having the same issue here. I am trying to install the polychoric PCA from (https://staskolenikov.net/stata). I am getting this error message.

            Command: net describe polychoric, from(http://staskolenikov.net/stata)

            Error message
            file http://staskolenikov.net/stata/stata.toc not found
            server says file permanently redirected to https://staskolenikov.net/stata/stata.toc
            http://staskolenikov.net/stata/ either
            1) is not a valid URL, or
            2) could not be contacted, or
            3) is not a Stata download site (has no stata.toc file).

            As James Hassel suggested, I tried to disable ssl certificate authentication in Stata using:

            Command: set sslrelax on

            However, I got this error message:

            -set sslrelax- not allowed; 'sslrelax' not recognized
            r(199);

            This is the information about my Stata:
            Stata/IC 15.1 for Mac (64-bit Intel)
            Revision 03 Feb 2020

            Kindly help, please.

            Comment


            • #7
              Funminiyi Oyawole , older versions of Stata such as Stata 15 did not support redirects. In this case, it looks like the server is redirecting to use https instead of http. Try
              Code:
              net describe polychoric, from(https://staskolenikov.net/stata)
              Note the change from http to https.

              Comment


              • #8
                Thank you James Hassell (StataCorp) . I just tried this, and I have been able to install.

                Comment

                Working...
                X