Skip to content

Commit 6b87cc7

Browse files
committed
github: support GCM_ALLOW_UNSAFE_REMOTES option
1 parent 2fbe3d6 commit 6b87cc7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/shared/GitHub/GitHubHostProvider.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,13 @@ public virtual Task EraseCredentialAsync(InputArguments input)
285285
ThrowIfDisposed();
286286

287287
// We should not allow unencrypted communication and should inform the user
288-
if (StringComparer.OrdinalIgnoreCase.Equals(remoteUri.Scheme, "http"))
288+
if (!_context.Settings.AllowUnsafeRemotes &&
289+
StringComparer.OrdinalIgnoreCase.Equals(remoteUri.Scheme, "http"))
289290
{
290291
throw new Trace2Exception(_context.Trace2,
291-
"Unencrypted HTTP is not supported for GitHub. Ensure the repository remote URL is using HTTPS.");
292+
"Unencrypted HTTP is not recommended for GitHub. " +
293+
"Ensure the repository remote URL is using HTTPS " +
294+
$"or see {Constants.HelpUrls.GcmUnsafeRemotes} about how to allow unsafe remotes.");
292295
}
293296

294297
string service = GetServiceName(remoteUri);

0 commit comments

Comments
 (0)