From c95fc45408942ef97005444790cc080fbe7e8ae9 Mon Sep 17 00:00:00 2001 From: Chris Schlaeger Date: Sat, 8 Jun 2019 09:32:55 +0200 Subject: Fix: Use SSL to download EPO file Looks like Garmin has disabled the HTTP service and now provides a HTTPS service. We now use SSL to download the EPO file. --- lib/postrunner/EPO_Downloader.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/postrunner/EPO_Downloader.rb b/lib/postrunner/EPO_Downloader.rb index 327bff7..6724dae 100644 --- a/lib/postrunner/EPO_Downloader.rb +++ b/lib/postrunner/EPO_Downloader.rb @@ -12,6 +12,7 @@ require 'uri' require 'net/http' +require 'net/https' module PostRunner @@ -20,7 +21,7 @@ module PostRunner # devices pick up this file under GARMIN/GARMIN/REMOTESW/EPO.BIN. class EPO_Downloader - @@URI = URI('http://omt.garmin.com/Rce/ProtobufApi/EphemerisService/GetEphemerisData') + @@URI = URI('https://omt.garmin.com/Rce/ProtobufApi/EphemerisService/GetEphemerisData') # This is the payload of the POST request. It was taken from # http://www.kluenter.de/garmin-ephemeris-files-and-linux/. It may contain # a product ID or serial number. @@ -33,7 +34,8 @@ module PostRunner # Create an EPO_Downloader object. def initialize - @http = Net::HTTP.new(@@URI.host, @@URI.port) + @https = Net::HTTP.new(@@URI.host, @@URI.port) + @https.use_ssl = true @request = Net::HTTP::Post.new(@@URI.path, initheader = @@HEADER) @request.body = @@POST_DATA end @@ -57,7 +59,7 @@ module PostRunner def get_epo_from_server begin - res = @http.request(@request) + res = @https.request(@request) rescue => e Log.error "Extended Prediction Orbit (EPO) data download error: " + e.message -- cgit v1.2.3