Search code examples
httphttpsvb6activexchilkat

Chilkat HTTP with https


I'm currently using the Chilkat HTTP ActiveX control (version 9.3.2.0) with VB6... One of the servers where I download files from is switching over to https, but I can't get it to work... Using http it works perfectly, but when I change the URL to https it returns 0.

Here is the result of Http.LastErrorText:

ChilkatLog:
  Download:
    DllDate: Aug  5 2012
    UnlockPrefix: **********
    Username: BILL-DESKTOP:Bill
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    backgroundThread: 0
    url: https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f000&lev_10_m_above_ground=on&lev_2_m_above_ground=on&lev_entire_atmosphere=on&lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29=on&lev_mean_sea_level=on&lev_surface=on&var_APCP=on&var_PRMSL=on&var_TCDC=on&var_TMP=on&var_UGRD=on&var_VGRD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.2018120712
    toLocalPath: C:\Progra~1\PCGrADS\gfs\grib\gfs_pgrbf_000.grib2
    localFileAlreadyExists: 0
    QuickGetToOutput_Download:
      qGet_1:
        simpleHttpRequest_3:
          httpMethod: GET
          requestUrl: https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f000&lev_10_m_above_ground=on&lev_2_m_above_ground=on&lev_entire_atmosphere=on&lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29=on&lev_mean_sea_level=on&lev_surface=on&var_APCP=on&var_PRMSL=on&var_TCDC=on&var_TMP=on&var_UGRD=on&var_VGRD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.2018120712
          Connecting to web server...
          httpServer: nomads.ncep.noaa.gov
          port: 443
          Using HTTPS.
          ConnectTimeoutMs_1: 10000
          calling ConnectSocket2
          IPV6 enabled connect with NO heartbeat.
          connectingTo: nomads.ncep.noaa.gov
          dnsCacheLookup: nomads.ncep.noaa.gov
          Resolving domain name (IPV4)
          GetHostByNameHB_ipv4: Elapsed time: 140 millisec
          myIP_1: 192.168.1.38
          myPort_1: 55564
          connect successful (1)
          clientHelloMajorMinorVersion: 3.1
          buildClientHello:
            majorVersion: 3
            minorVersion: 1
            numRandomBytes: 32
            sessionIdSize: 0
            numCipherSuites: 10
            numCompressionMethods: 1
          --buildClientHello
          TlsAlert:
            level: fatal
            descrip: handshake failure
          --TlsAlert
          Closing connection in response to fatal error.
          Failed to read incoming handshake messages. (1)
          Client handshake failed. (3)
          Failed to connect to HTTP server.
          connectElapsedMs: 640
        --simpleHttpRequest_3
      --qGet_1
    --QuickGetToOutput_Download
    bFileDeleted: 1
    totalElapsedMs: 672
    ContentLength: 0
    Failed.
  --Download
--ChilkatLog

What am I doing wrong?

Regards,

Bill


Solution

  • You were using an old version from 2012, which did not yet implement TLS 1.2. Chilkat has since added support for TLS 1.2 (for many years now) and the latest version should work fine.