X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Fgdc_certificate_panel.cc;h=d78b1b56dfd2397bda51331cda5c7e0c0e43c938;hp=e670f01eb4815f543a07cf96ac061e88ef89f031;hb=1c1676c83d5785e4c6a2212e68a8dff46eab4847;hpb=e49fafc6388cec38e9e78e2c9d5d1f5890c13066 diff --git a/src/wx/gdc_certificate_panel.cc b/src/wx/gdc_certificate_panel.cc index e670f01eb..d78b1b56d 100644 --- a/src/wx/gdc_certificate_panel.cc +++ b/src/wx/gdc_certificate_panel.cc @@ -18,20 +18,25 @@ */ -#include "gdc_certificate_panel.h" + #include "download_certificate_dialog.h" +#include "gdc_certificate_panel.h" #include "wx_util.h" -#include "lib/internet.h" #include "lib/compose.hpp" #include "lib/config.h" +#include "lib/internet.h" +#include + using std::string; -using boost::optional; +using namespace boost::algorithm; using boost::bind; +using boost::optional; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif + GDCCertificatePanel::GDCCertificatePanel (DownloadCertificateDialog* dialog) : CredentialsDownloadCertificatePanel ( dialog, @@ -50,16 +55,18 @@ void GDCCertificatePanel::do_download () { string serial = wx_to_std (_serial->GetValue()); + trim(serial); if (!serial.empty() && serial[0] == 'A') { /* We're adding the A ourselves */ serial = serial.substr(1); } - string const url = String::compose( + string url = String::compose( "ftp://%1:%2@ftp.gdc-tech.com/SHA256/A%3.crt.pem", Config::instance()->gdc_username().get(), Config::instance()->gdc_password().get(), serial ); + trim(url); auto error = get_from_url (url, true, false, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1, _2));