Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-10-07 13:43:41 -0400
committerThomas Wolf2019-10-07 13:43:41 -0400
commit909896cf1a7657ac721045f673983eed57664643 (patch)
tree0986f7eff8e1f5d0cc2852405e1b9a18bbf3abd1 /org.eclipse.egit.ui
parent34a18ec423eeebeca5b84eb84e752d8b19e0111f (diff)
downloadegit-909896cf1a7657ac721045f673983eed57664643.tar.gz
egit-909896cf1a7657ac721045f673983eed57664643.tar.xz
egit-909896cf1a7657ac721045f673983eed57664643.zip
Use Apache HTTP by default
Add a preference with UI to choose between the JDK built-in HTTP handling and Apache HTTP. Set the default to Apache HTTP. In case of trouble the user can switch back to using the Java standard HTTP client. The advantage of the Apache HTTP client is that it allows using Basic authentication when HTTPS connections are to be made over an HTTP proxy. OpenJDK forbids that by default since Java 8u111,[1] and changing the JDK configuration to re-allow it is not obvious at all and cannot be done automatically from within Eclipse. [1] https://bugs.openjdk.java.net/browse/JDK-8210814 Bug: 549832 Change-Id: I71928b627d3af4dae95bdab63e019c75ab7e6a9e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitPreferenceRoot.java19
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties3
3 files changed, 31 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
index 394df7030..a37cc913c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
@@ -694,6 +694,12 @@ public class UIText extends NLS {
public static String GitPreferenceRoot_DefaultRepoFolderVariableButton;
/** */
+ public static String GitPreferenceRoot_HttpClient_Jdk_Label;
+
+ /** */
+ public static String GitPreferenceRoot_HttpClient_Apache_Label;
+
+ /** */
public static String GitPreferenceRoot_MergeGroupHeader;
/** */
@@ -4892,6 +4898,9 @@ public class UIText extends NLS {
public static String GitPreferenceRoot_MaxPullThreadsCountTooltip;
/** */
+ public static String RemoteConnectionPreferencePage_HttpClientLabel;
+
+ /** */
public static String RemoteConnectionPreferencePage_SshClientLabel;
/** */
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitPreferenceRoot.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitPreferenceRoot.java
index 3e6b63363..61d9c7704 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitPreferenceRoot.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitPreferenceRoot.java
@@ -56,6 +56,8 @@ public class GitPreferenceRoot extends DoublePreferencesPreferencePage
private final static String[][] SSH_CLIENT_NAMES_AND_VALUES = new String[2][2];
+ private final static String[][] HTTP_CLIENT_NAMES_AND_VALUES = new String[2][2];
+
private final static boolean HAS_DEBUG_UI = hasDebugUiBundle();
static {
@@ -70,6 +72,11 @@ public class GitPreferenceRoot extends DoublePreferencesPreferencePage
SSH_CLIENT_NAMES_AND_VALUES[0][1] = "jsch"; //$NON-NLS-1$
SSH_CLIENT_NAMES_AND_VALUES[1][0] = UIText.GitPreferenceRoot_SshClient_Apache_Label;
SSH_CLIENT_NAMES_AND_VALUES[1][1] = "apache"; //$NON-NLS-1$
+
+ HTTP_CLIENT_NAMES_AND_VALUES[0][0] = UIText.GitPreferenceRoot_HttpClient_Jdk_Label;
+ HTTP_CLIENT_NAMES_AND_VALUES[0][1] = "jdk"; //$NON-NLS-1$
+ HTTP_CLIENT_NAMES_AND_VALUES[1][0] = UIText.GitPreferenceRoot_HttpClient_Apache_Label;
+ HTTP_CLIENT_NAMES_AND_VALUES[1][1] = "apache"; //$NON-NLS-1$
}
/**
@@ -225,6 +232,18 @@ public class GitPreferenceRoot extends DoublePreferencesPreferencePage
};
addField(sshClient);
+ ComboFieldEditor httpClient = new ComboFieldEditor(
+ GitCorePreferences.core_httpClient,
+ UIText.RemoteConnectionPreferencePage_HttpClientLabel,
+ HTTP_CLIENT_NAMES_AND_VALUES, remoteConnectionsGroup) {
+
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ return getSecondaryPreferenceStore();
+ }
+
+ };
+ addField(httpClient);
updateMargins(remoteConnectionsGroup);
Group repoChangeScannerGroup = new Group(main, SWT.SHADOW_ETCHED_IN);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
index dbc7ada86..e06b885aa 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
@@ -250,6 +250,8 @@ GitPreferenceRoot_CloningRepoGroupHeader=Cloning repositories
GitPreferenceRoot_DefaultRepoFolderLabel=Default repository &folder:
GitPreferenceRoot_DefaultRepoFolderTooltip=This folder will be suggested as parent folder when cloning a remote repository
GitPreferenceRoot_DefaultRepoFolderVariableButton=&Variable...
+GitPreferenceRoot_HttpClient_Jdk_Label=Java built-in HTTP
+GitPreferenceRoot_HttpClient_Apache_Label=Apache HTTP
GitPreferenceRoot_MergeGroupHeader=Merge
GitPreferenceRoot_MergeMode_0_Label=Prompt when starting tool
GitPreferenceRoot_MergeMode_1_Label=Workspace (pre-merged by Git)
@@ -1765,6 +1767,7 @@ NotesEditorPage_Title=Notes
GitPreferenceRoot_MaxPullThreadsCount=&Maximum number of parallel pulls:
GitPreferenceRoot_MaxPullThreadsCountTooltip=1 disables parallel pulls
+RemoteConnectionPreferencePage_HttpClientLabel=&HTTP client:
RemoteConnectionPreferencePage_SshClientLabel=&SSH client:
RemoteConnectionPreferencePage_TimeoutLabel=&Connection timeout (seconds):
RemoteConnectionPreferencePage_ZeroValueTooltip=0 is equivalent to no timeout

Back to the top