Commit fc1e507c authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Fixed a problem with edrget failing on https requests on OS X. References #4771.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7810 41f8697f-d340-4b68-9986-7bafba869bb8
parent d4d76207
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -2,9 +2,12 @@

#include <iostream>

#include <QString>
#include <QtCore>
#include <QMessageBox>
#include <QtNetwork>
#include <QSysInfo>


#include "Application.h"
#include "IException.h"
@@ -88,9 +91,24 @@ namespace Isis {
    // Establish the connection and start the GET request
    m_networkMgr.connectToHost(url.host(),url.port());


    // We obtain ownership of the QNetworkReply *, so need to delete later

    m_reply = m_networkMgr.get(QNetworkRequest(url));

    QString productType(QSysInfo::productType());
    productType = productType.toLower();

    //If this is running on OS X, then this if statement gets around the SSL Handshaking
    //errors because Qt is not looking for the DOI root certificate in the correct
    //place.  Probably here:  /System/Library/Keychains/SystemRootCertificates.keychain
    //which is where curl looks when downloading this file.

    if (productType.contains("osx") ) {
       m_reply->ignoreSslErrors();
    }


    connect(m_reply, SIGNAL(finished()),
            this, SLOT(connectionFinished()));
    connect(m_reply, SIGNAL(readyRead()),
@@ -105,7 +123,7 @@ namespace Isis {



   //tjw:  Timeout event handler monitors the ftp connection and gracefully
   //Timeout event handler monitors the ftp connection and gracefully
  //closes and exits the application if a timeout occurs.
  void ResourceGet::connectionTimeout() {
      QString timeoutSecs = QString("Timeout error:  GET request exceeded ") +
@@ -129,6 +147,7 @@ namespace Isis {
      // Error message is already set if we encountered a TIMEOUT
      if (m_errorMessage.isEmpty()) {
        m_errorMessage = m_reply->errorString();
        cout << m_errorMessage << endl;
      }
      
      if (m_errorMessage.contains("Timeout error")) {
+2 −5
Original line number Diff line number Diff line
@@ -48,13 +48,10 @@ void IsisMain() {
      }

      //////////////////////////////////////////////////////////////////////////////////
      // tjw(ref#2259):  The line below starts a child process that launches
      // The line below starts a child process that launches
      // $ISISROOT/bin/edrget .  This was done because QMainWindow::instance()->exec()
      // which starts the event processing loop has already been called, and
      // cannot be called again to catch events from the FtpGet/HttpGet objects.
      // Launching a child process appears to have been a quick and dirty way
      // to get around this.  This code should be refactored under a future ticket.
      // There is a lot of code duplication.
      //////////////////////////////////////////////////////////////////////////////////

      ProgramLauncher::RunIsisProgram("edrget", parameters);
+6 −0
Original line number Diff line number Diff line
@@ -44,6 +44,12 @@ xsi:noNamespaceSchemaLocation=
    <change name="Makayla Shepherd" date="2017-03-02">
        Added https to reflect changes in the server.
    </change>
    <change name="Tyler Wilson" date="2017-06-29">
        Changed ResourceGet::getResource function.  If there are SSL handshaking errors
        when attempting to download an https resource,
        and this application is running on OS X, the network reply is instructed to
        ignore the errors.  References #4771.
    </change>
  </history>