@@ -650,6 +650,7 @@ protected void validateConfig(final Printout printout,
650650 String endpoint = conf .getTrimmed (ENDPOINT , "" ).toLowerCase (Locale .ROOT );
651651 String region = conf .getTrimmed (REGION , "" ).toLowerCase (Locale .ROOT );
652652 String bucket = getFsURI ().getHost ();
653+ boolean privateLink = false ;
653654
654655
655656 boolean secureConnections = conf .getBoolean (SECURE_CONNECTIONS ,
@@ -660,15 +661,6 @@ protected void validateConfig(final Printout printout,
660661 printout .println ("%s = \" %s\" " , PATH_STYLE_ACCESS , pathStyleAccess );
661662 printout .println ("%s = \" %s\" " , SECURE_CONNECTIONS , secureConnections );
662663
663- if (endpoint .startsWith ("https:" ) || endpoint .startsWith ("http:" )) {
664- printout .warn ("Value of %s looks like a URL: %s" , ENDPOINT , endpoint );
665- printout .println ("It SHOULD normally be a hostname or IP address" );
666- printout .println ("Unless you have a private store with a non-standard port or"
667- + " are using AWS S3 PrivateLink" );
668- if (!pathStyleAccess ) {
669- printout .warn ("You should probably set %s to true" , PATH_STYLE_ACCESS );
670- }
671- }
672664 boolean isUsingAws = false ;
673665 if (endpoint .isEmpty ()) {
674666 isUsingAws = true ;
@@ -680,11 +672,12 @@ protected void validateConfig(final Printout printout,
680672 + " tune " + PATH_STYLE_ACCESS
681673 + " and " + SECURE_CONNECTIONS + " as appropriate" );
682674 }
683- } else if (endpoint .endsWith ("amazonaws.cn" )) {
675+ } else if (endpoint .endsWith ("amazonaws.cn" ) || endpoint . endsWith ( "amazonaws.cn/" ) ) {
684676 isUsingAws = true ;
685677 printout .println ("AWS china is in use" );
686- } else if (endpoint .endsWith (".vpce.amazonaws.com" )) {
678+ } else if (endpoint .endsWith (".vpce.amazonaws.com" ) || endpoint . endsWith ( ".vpce.amazonaws.com/" ) ) {
687679 isUsingAws = true ;
680+ privateLink = true ;
688681 printout .println ("AWS VPCE is being used for a VPN connection to S3" );
689682 printout .warn ("you MUST set %s to the region of this store; it is currently \" %s\" " ,
690683 REGION , region );
@@ -721,7 +714,17 @@ protected void validateConfig(final Printout printout,
721714 }
722715
723716 }
724- if (isUsingAws ) {
717+
718+ if (!privateLink && (endpoint .startsWith ("https:" ) || endpoint .startsWith ("http:" ))) {
719+ printout .warn ("Value of %s looks like a URL: %s" , ENDPOINT , endpoint );
720+ printout .println ("It SHOULD normally be a hostname or IP address" );
721+ printout .println ("Unless you have a private store with a non-standard port or"
722+ + " are using AWS S3 PrivateLink" );
723+ if (!pathStyleAccess ) {
724+ printout .warn ("You should probably set %s to true" , PATH_STYLE_ACCESS );
725+ }
726+ }
727+ if (!privateLink && isUsingAws ) {
725728 printout .println ("Important: if you are working with a third party store," );
726729 printout .println (" this client is still trying to connect to to AWS S3" );
727730 printout .println ("Expect failure until %s is set to the private endpoint" , ENDPOINT );
0 commit comments