@@ -55,8 +55,8 @@ public bool IsSupported(InputArguments input)
55
55
return false ;
56
56
}
57
57
58
- // We do not support unencrypted HTTP communications to Bitbucket,
59
- // but we report `true` here for HTTP so that we can show a helpful
58
+ // We do not recommend unencrypted HTTP communications to Bitbucket, but it is possible.
59
+ // Therefore, we report `true` here for HTTP so that we can show a helpful
60
60
// error message for the user in `GetCredentialAsync`.
61
61
return ( StringComparer . OrdinalIgnoreCase . Equals ( input . Protocol , "http" ) ||
62
62
StringComparer . OrdinalIgnoreCase . Equals ( input . Protocol , "https" ) ) &&
@@ -81,11 +81,14 @@ public bool IsSupported(HttpResponseMessage response)
81
81
public async Task < ICredential > GetCredentialAsync ( InputArguments input )
82
82
{
83
83
// We should not allow unencrypted communication and should inform the user
84
- if ( StringComparer . OrdinalIgnoreCase . Equals ( input . Protocol , "http" )
85
- && BitbucketHelper . IsBitbucketOrg ( input ) )
84
+ if ( ! _context . Settings . AllowUnsafeRemotes &&
85
+ StringComparer . OrdinalIgnoreCase . Equals ( input . Protocol , "http" ) &&
86
+ BitbucketHelper . IsBitbucketOrg ( input ) )
86
87
{
87
88
throw new Trace2Exception ( _context . Trace2 ,
88
- "Unencrypted HTTP is not supported for Bitbucket.org. Ensure the repository remote URL is using HTTPS." ) ;
89
+ "Unencrypted HTTP is not recommended for Bitbucket.org. " +
90
+ "Ensure the repository remote URL is using HTTPS " +
91
+ $ "or see { Constants . HelpUrls . GcmUnsafeRemotes } about how to allow unsafe remotes.") ;
89
92
}
90
93
91
94
var authModes = await GetSupportedAuthenticationModesAsync ( input ) ;
0 commit comments