@@ -113,7 +113,7 @@ public Answer executeRequest(final Command cmd) {
113113
114114 private Answer execute (StartConsoleProxyAgentHttpHandlerCommand cmd ) {
115115 s_logger .info ("Invoke launchConsoleProxy() in responding to StartConsoleProxyAgentHttpHandlerCommand" );
116- launchConsoleProxy (cmd .getKeystoreBits (), cmd .getKeystorePassword (), cmd .getEncryptorPassword ());
116+ launchConsoleProxy (cmd .getKeystoreBits (), cmd .getKeystorePassword (), cmd .getEncryptorPassword (), cmd . isSourceIpCheckEnabled () );
117117 return new Answer (cmd );
118118 }
119119
@@ -313,7 +313,7 @@ public String getName() {
313313 return _name ;
314314 }
315315
316- private void launchConsoleProxy (final byte [] ksBits , final String ksPassword , final String encryptorPassword ) {
316+ private void launchConsoleProxy (final byte [] ksBits , final String ksPassword , final String encryptorPassword , final Boolean isSourceIpCheckEnabled ) {
317317 final Object resource = this ;
318318 s_logger .info ("Building class loader for com.cloud.consoleproxy.ConsoleProxy" );
319319 if (_consoleProxyMain == null ) {
@@ -325,8 +325,8 @@ protected void runInContext() {
325325 Class <?> consoleProxyClazz = Class .forName ("com.cloud.consoleproxy.ConsoleProxy" );
326326 try {
327327 s_logger .info ("Invoke startWithContext()" );
328- Method method = consoleProxyClazz .getMethod ("startWithContext" , Properties .class , Object .class , byte [].class , String .class , String .class );
329- method .invoke (null , _properties , resource , ksBits , ksPassword , encryptorPassword );
328+ Method method = consoleProxyClazz .getMethod ("startWithContext" , Properties .class , Object .class , byte [].class , String .class , String .class , Boolean . class );
329+ method .invoke (null , _properties , resource , ksBits , ksPassword , encryptorPassword , isSourceIpCheckEnabled );
330330 } catch (SecurityException e ) {
331331 s_logger .error ("Unable to launch console proxy due to SecurityException" , e );
332332 System .exit (ExitStatus .Error .value ());
@@ -358,6 +358,8 @@ protected void runInContext() {
358358 Class <?> consoleProxyClazz = Class .forName ("com.cloud.consoleproxy.ConsoleProxy" );
359359 Method methodSetup = consoleProxyClazz .getMethod ("setEncryptorPassword" , String .class );
360360 methodSetup .invoke (null , encryptorPassword );
361+ methodSetup = consoleProxyClazz .getMethod ("setIsSourceIpCheckEnabled" , Boolean .class );
362+ methodSetup .invoke (null , isSourceIpCheckEnabled );
361363 } catch (SecurityException e ) {
362364 s_logger .error ("Unable to launch console proxy due to SecurityException" , e );
363365 System .exit (ExitStatus .Error .value ());
0 commit comments