mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
#959 added option to disable ssl validation for scm mercurial hook
This commit is contained in:
@@ -63,6 +63,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
@@ -78,6 +79,8 @@ import javax.servlet.http.HttpSession;
|
||||
public class HgCGIServlet extends HttpServlet
|
||||
{
|
||||
|
||||
private static final String ENV_PYTHON_HTTPS_VERIFY = "PYTHONHTTPSVERIFY";
|
||||
|
||||
/** Field description */
|
||||
public static final String ENV_REPOSITORY_NAME = "REPO_NAME";
|
||||
|
||||
@@ -268,9 +271,16 @@ public class HgCGIServlet extends HttpServlet
|
||||
directory.getAbsolutePath());
|
||||
|
||||
// add hook environment
|
||||
Map<String, String> environment = executor.getEnvironment().asMutableMap();
|
||||
if (handler.getConfig().isDisableHookSSLValidation()) {
|
||||
// disable ssl validation
|
||||
// Issue 959: https://goo.gl/zH5eY8
|
||||
environment.put(ENV_PYTHON_HTTPS_VERIFY, "0");
|
||||
}
|
||||
|
||||
//J-
|
||||
HgEnvironment.prepareEnvironment(
|
||||
executor.getEnvironment().asMutableMap(),
|
||||
environment,
|
||||
handler,
|
||||
hookManager,
|
||||
request
|
||||
|
||||
Reference in New Issue
Block a user