forked from I2P_Developers/i2p.i2p
SAM: Add warning at startup if not bound to localhost
This commit is contained in:
@@ -216,6 +216,17 @@ public class SAMBridge implements Runnable, ClientApp {
|
||||
* @since 0.9.6
|
||||
*/
|
||||
private void openSocket() throws IOException {
|
||||
if (!DEFAULT_TCP_HOST.equals(_listenHost) &&
|
||||
!"localhost".equals(_listenHost) &&
|
||||
!"::1".equals(_listenHost) &&
|
||||
!"0:0:0:0:0:0:0:1".equals(_listenHost) &&
|
||||
!(_useSSL && Boolean.parseBoolean(i2cpProps.getProperty(SAMBridge.PROP_AUTH)))) {
|
||||
String m = "SECURITY WARNING: SAM interface not restricted to localhost, and SSL and Authentication are not enabled.\n" +
|
||||
"Remote access to local services may be possible.\n" +
|
||||
"Please check command line and configuration.";
|
||||
_log.logAlways(Log.WARN, m);
|
||||
System.out.println(m);
|
||||
}
|
||||
if (_useSSL) {
|
||||
SSLServerSocketFactory fact = SSLUtil.initializeFactory(i2cpProps);
|
||||
InetAddress addr;
|
||||
|
||||
Reference in New Issue
Block a user