@@ -455,7 +455,8 @@ public static String findProxyUrl(String proxyUrl, String protocol) {
455455 switch (protocol .toLowerCase ()) {
456456 case Constants .HTTP :
457457 case Constants .HTTPS :
458- retVal = System .getenv (String .format ("%s_proxy" , protocol ));
458+ String envVarName = String .format ("%s_proxy" , protocol );
459+ retVal = getProxyEnvironmentVariableValue (envVarName );
459460 if (isEmptyString (retVal )) {
460461 String proxyHost = System .getProperty (String .format ("%s.proxyHost" , protocol ), null );
461462 String proxyPort = System .getProperty (String .format ("%s.proxyPort" , protocol ), "80" );
@@ -466,7 +467,7 @@ public static String findProxyUrl(String proxyUrl, String protocol) {
466467 break ;
467468 case "none" :
468469 default :
469- retVal = System . getenv ("no_proxy" );
470+ retVal = getProxyEnvironmentVariableValue ("no_proxy" );
470471 if (isEmptyString (retVal )) {
471472 retVal = System .getProperty ("http.nonProxyHosts" , null );
472473 if (!isEmptyString (retVal )) {
@@ -658,8 +659,13 @@ public static void setInventoryLocation(String inventoryLocFile, DockerfileOptio
658659 }
659660 }
660661
661-
662-
662+ private static String getProxyEnvironmentVariableValue (String envVarName ) {
663+ String retVal = System .getenv (envVarName .toLowerCase ());
664+ if (isEmptyString (retVal )) {
665+ retVal = System .getenv (envVarName .toUpperCase ());
666+ }
667+ return retVal ;
668+ }
663669
664670 private static boolean validFile (Path file ) throws IOException {
665671 return file != null && Files .isRegularFile (file ) && Files .size (file ) > 0 ;
0 commit comments