File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
core/src/main/java/ch/cyberduck/core
s3/src/main/java/ch/cyberduck/core/s3 Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -685,6 +685,9 @@ public Map<String, String> getProperties() {
685685 property -> StringUtils .contains (property , '=' ) ? substitutor .replace (StringUtils .substringAfter (property , '=' )) : StringUtils .EMPTY )));
686686 // In profile as dict
687687 properties .putAll (this .map (PROPERTIES_KEY ));
688+ if (null != this .getContext ()) {
689+ properties .put (CONTEXT_KEY , this .getContext ());
690+ }
688691 return properties ;
689692 }
690693
Original file line number Diff line number Diff line change 2727import ch .cyberduck .core .LoginCallback ;
2828import ch .cyberduck .core .Path ;
2929import ch .cyberduck .core .PathContainerService ;
30+ import ch .cyberduck .core .Profile ;
3031import ch .cyberduck .core .Scheme ;
3132import ch .cyberduck .core .TemporaryAccessTokens ;
3233import ch .cyberduck .core .UrlProvider ;
@@ -268,10 +269,11 @@ protected S3CredentialsStrategy configureCredentialsStrategy(final HttpClientBui
268269 }
269270 if (S3Session .isAwsHostname (host .getHostname ())) {
270271 // Try auto-configure
271- if (Scheme .isURL (host .getProtocol ().getContext ())) {
272- log .debug ("Auto-configure credentials from instance metadata {}" , host .getProtocol ().getContext ());
272+ final String context = preferences .getProperty (Profile .CONTEXT_KEY );
273+ if (Scheme .isURL (context )) {
274+ log .debug ("Auto-configure credentials from HTTP endpoint {}" , context );
273275 // Fetch temporary session token from instance metadata
274- return new AWSSessionCredentialsRetriever (trust , key , host . getProtocol (). getContext () );
276+ return new AWSSessionCredentialsRetriever (trust , key , context );
275277 }
276278 }
277279 if (host .getProtocol ().isRoleConfigurable ()) {
You can’t perform that action at this time.
0 commit comments