Announcement

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:

insheet using "https://www.economia.gob.ar/dnap/recursos/ron/montos_diarios/2021/enero2021/internet_diario.xls"
import excel using "https://www.economia.gob.ar/dnap/recursos/ron/montos_diarios/2021/enero2021/internet_diario.xls"
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!

Tags: None James Hassell (StataCorp) StataCorp Employee 02 Sep 2021, 13:48

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.

. 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

Post Cancel Katriel Friedman 21 Dec 2021, 18:28

I am getting the same error at a different website.

. 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

Post Cancel James Hassell (StataCorp) StataCorp Employee 22 Dec 2021, 14:18 The command you posted works for me on multiple versions of Stata (13-17).
. 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

Post Cancel Katriel Friedman 23 Dec 2021, 08:25 Thanks so much, James. I think it must be my employer's VPN/proxy server then.

Comment

Post Cancel Funminiyi Oyawole 02 Apr 2024, 09:26

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