Announcement

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

  • Error r(603) when I import data from https site. How to fix it?

    I used to import data from a http site but recent days, the site switch to https and I got an error code when importing data from that site.

    How to fix it?

    Error is like that:
    Code:
    sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification pa
    > th to requested target
    could not open url
    My code to import data from that site
    Code:
    import delimited https://thatsite/file.txt, delimiter(tab, collapse) clear
    I found this package but still can not use it to import data: https://www.ssc.wisc.edu/sscc/pubs/readhtml.htm

    Thank you all.
    Last edited by Thong Nguyen; 10 Jul 2020, 06:37.

  • #2
    What verson of Stata are you using? Show us the first two lines of results running the about command.
    Code:
    . about
    
    Stata/SE 16.1 for Mac (64-bit Intel)
    Revision 30 Jun 2020
    It would be helpful had you shown the actual URL you are using so we could try to replicate the problem.

    Your problem seems to result from Stata's attempt to connect to a site using https. Older versions of Stata had problems, although the symptoms you see are not the usual ones reported in that case.

    What happens when you open the URL in a web browser?

    The readhtml package has no role in solving your problem; Stata is unable to connect to the remote server, and readhtml uses Stata to do so.

    Comment


    • #3
      Code:
      . about
      
      Stata/MP 14.0 for Windows (32-bit)
      Revision 22 Apr 2015
      Copyright 1985-2015 StataCorp LP
      The code I use to import data from the https site is as following

      Code:
      import delimited https://loyce.club/Merit/merit.all.txt, delimiter(tab, collapse) clear
      Thank you for your help.

      Comment


      • #4
        You need to update your Stata. Stata improved access to https sites during the lifetime of 14.

        I found this at https://www.stata.com/help.cgi?whatsnew14 which should be visible to you too.
        ----- update 22sep2015 -----------------------------------------------------
        1. Stata has improved execution for operations using the https:// protocol and when using a proxy server. Stata now sends a CONNECT request to the proxy server, which is the standard Java implementation and is the preferred method for secure sockets layer (SSL) connections.

        Comment


        • #5
          Hi everyone! I'm having the same issue, although my Stata version is 16. For my case, the command and website I'm trying to reach are:

          Code:
          import delimited "https://www.secciones.hacienda.gob.mx/work/models/estadisticas_oportunas/datos_abiertos_eopf/ingreso_gasto_finan.csv", clear
          And I'm using this approach because that dataset is updated every month, and it would be very useful if I can update it automatically from Stata.

          Thanks for your help!

          Comment

          Working...
          X