diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 9c9e7e0f30..ab636a03ea 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -174,6 +174,9 @@ void AppConfig::set_defaults() if (get("show_hints").empty()) set("show_hints", "1"); + if (get("allow_ip_resolve").empty()) + set("allow_ip_resolve", "1"); + #ifdef _WIN32 if (get("use_legacy_3DConnexion").empty()) set("use_legacy_3DConnexion", "0"); diff --git a/src/slic3r/Utils/OctoPrint.cpp b/src/slic3r/Utils/OctoPrint.cpp index 58431691cf..df2e0d2b17 100644 --- a/src/slic3r/Utils/OctoPrint.cpp +++ b/src/slic3r/Utils/OctoPrint.cpp @@ -15,6 +15,7 @@ #include "slic3r/GUI/I18N.hpp" #include "slic3r/GUI/GUI.hpp" #include "Http.hpp" +#include "libslic3r/AppConfig.hpp" namespace fs = boost::filesystem; @@ -115,7 +116,9 @@ bool OctoPrint::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Erro std::string url; bool res = true; - if (m_host.find("https://") == 0 || test_msg.empty()) { + bool allow_ip_resolve = GUI::get_app_config()->get("allow_ip_resolve") == "1"; + + if (m_host.find("https://") == 0 || test_msg.empty() || !allow_ip_resolve) { // If https is entered we assume signed ceritificate is being used // IP resolving will not happen - it could resolve into address not being specified in cert url = make_url("api/files/local");