SSL enabled
Java SFS client API version : 1.7.5
Java client sdk version :1.7
Config settings mention :
Code: Select all
<ip>192.168.67.229</ip>
<udpIp>192.168.67.229</udpIp>
<port>9933</port>
<udpPort>9933</udpPort>
<zone>BasicKing</zone>
<!-- End Mandatory Settings -->
<debug>false</debug>
<!-- For generic http port communication -->
<httpPort>8081</httpPort>
<httpsPort>8892</httpsPort>
<!-- BlueBox settings -->
<useBlueBox>true</useBlueBox>
<blueBoxPollingRate>700</blueBoxPollingRate>
config Load code
Code: Select all
this.sfs = new SmartFox();
// here the true flag assures that SmartFox will automatically connect
// to server on successful load config.
try {
this.sfs.loadConfig(this.getCfgPath(), true);
} catch (Exception e) {
// System.out.println("Unable to connect to host.");
}
Connection code handler
Code: Select all
this.sfs.addEventListener(SFSEvent.CONNECTION, new IEventListener() {
public void dispatch(BaseEvent evt) throws SFSException {
Map params = evt.getArguments();
boolean isSuccess = (Boolean) params.get("success");
if (isSuccess) {
//useEncryption = true;
if(useEncryption){
try{
this.sfs.initCrypto();
}catch(Exception e){
System.out.println(" exception in initCrypto " + e);
}
/* The below line is not getting executed once above line is executing*/
System.out.println("BotSpawner.Connection established; Crypto Intialization Done");
}
} else {
System.out.println("BotSpawner.Connection failed");
}
}
});
Crypto Handler
Code: Select all
this.sfs.addEventListener(SFSEvent.CRYPTO_INIT, new IEventListener(){
@Override
public void dispatch(BaseEvent evt) throws SFSException {
Map params = evt.getArguments();
boolean isSuccess = (Boolean) params.get("success");
if(isSuccess){
this.sfs.send(new LoginRequest("ram","********","2");
}else{
System.out.println("Current Thread Name CRYPTO_INIT intialization falied:" );
}
}
});
Exception faced :
Code: Select all
SFSWorker:Sys:4 | controllers.v290.SystemReqController | | com.smartfoxserver.v2.exceptions.SFSRuntimeException: Login rejected. Client is not using an encrypted connection: { Id: 248, Type: DEFAULT, Logged: No, IP: 192.168.67.229:44120 }
com.smartfoxserver.v2.controllers.system.Login.validateEncryptionStatus(Login.java:130)
com.smartfoxserver.v2.controllers.system.Login.validate(Login.java:66)
com.smartfoxserver.v2.controllers.v290.SystemReqController.processRequest(SystemReqController.java:168)
com.smartfoxserver.v2.controllers.v290.SystemReqController.enqueueRequest(SystemReqController.java:127)
com.smartfoxserver.bitswarm.io.protocols.AbstractProtocolCodec.dispatchRequestToController(AbstractProtocolCodec.java:39)
com.smartfoxserver.v2.protocol.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:133)
com.smartfoxserver.v2.protocol.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:90)
com.smartfoxserver.v2.protocol.binary.BinaryIoHandler$1.run(BinaryIoHandler.java:477)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)