Error during WebSocket handshake: location mismatch: wss://* != ws://* - amazon-web-services

when i run MeteorJS(1.1.0.2) test in PhantomJS(1.9.8) get this error msg in Amazone AWS
Error during WebSocket handshake: location mismatch: wss://ddp--5539-torrentz.meteor.com/sockjs/102/chvlh52p/websocket != ws://ddp--5539-torrentz.meteor.com/sockjs/102/chvlh52p/websocket
& this prevent all MeteorJS Mongo DB operations

solved with upgrade phantomjs 1.9.8 to 2.0 in ubuntu

Related

Error during WebSocket handshake: Unexpected response code: 502 - Django

I am running my server on a ec2 instance with gunicorn and nginx. My site and project works but it gives error connecting with websockets. I am using Websocket in js to connect with Django channels. On my local server everything was working correctly but after deploying my site. Websockets are not working and giving me this error
Error during WebSocket handshake: Unexpected response code: 502.
What I have tried uptil now...
I have installed redis and daphne. Configured daphne setting in nginx configuration.
My Server is running on 80 port and I have set daphne on 8001 port.
When I start daphne service it runs for some time and then disconnect/fail automatically but when it is running my websockets still cant connect.
Any kind of help will be great for me.

Solr in Flask web app - Failed to connect to server - Failed to establish a new connection: [Errno 111] Connection refused

I have indexed files successfully using Solr, and queried the core successfully by using pysolr. The code is working fine in the Pycharm Terminal. Now I am trying to convert the code to a web app using Flask on pythonanywhere.com. However when I put the following line in the code for the web app I get an error:
solr = Solr('http://localhost:8983/solr/techproducts')
The error that I am getting is:
pysolr.SolrError: Failed to connect to server at http://localhost:8983/solr/techproducts/select/?q=Sumedh&wt=json: HTTPConnectionPool(host='localhost', port=8983): Max retries exceeded with url: /solr/techproducts/select/?q=Sumedh&wt=json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa57c3c28d0>: Failed to establish a new connection: [Errno 111] Connection refused',))
If someone can please help me in solving this error I would be really grateful.

Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER

I am new to grpc and tensorflow model server. I have built tensorflow model server (TF2.2) from source using bazel. I am trying to use tensorflow model server with SSL authentication. And I am not able to communicate properly between client and server.
Basically I am trying to test my TFserver with the help of two clients (for eg client A and client B, located at two different machines). Client A uses grpc with default SSL (boring SSL), and client B uses GRPC with OpenSSL 1.1.1g version. My TFserver is able to communicate with Client A but not with Client B. both the client code is written in C++. and both code is identical just the SSL version is different.
I have following questions :
I had tensorflow model server binary for tf1.x version as well. And in that binary I have these parameters (--enable_secure, --pkcs_password_encrypted, --pkcs_store_path, --pkcs_password_keystore_path, --enable_client_auth and --ssl_config_file) for implementing SSL Auth. but when I built TF2.2 model serving binary I only get --ssl_config_file parameter in it. So my question is did I do something wrong or forgot to pass some argument while building the TF serving?
Whenever I start my tensorflow model server with --ssl_config_file param it is throwing this error :
E1017 00:51:53.358762382 5881 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER
And this error is coming iteratively after every 5-10 seconds even before my client sends request to server. And as I have mentioned earlier that I am able to communicate with client A i.e. the one having GRPC with default SSL version (boringSSL) even after getting this error on TF model server side. But not able to communicate with client B where I have built GRPC with OpenSSL-1.1.1g version. What could be the possible reason?
I want to know, how I can get the logs on TFmodel server side? I am just getting startup log and the error log, but not getting the logs when client request to the server. I have tried with -v=1, but it did not work for me.
I am posting the command that I am using to start the server and server startup log with the error :
Command :
/home/user/TFSERVING/bin/tensorflow_model_server --port=9002 --model_config_file=/home/user/model_config.conf -v=1 --ssl_config_file=/home/user/TFSERVING/conf/tf_ssl.conf
server starting log :
.............................
.............................
I external/org_tensorflow/tensorflow/cc/saved_model/reader.cc:54] Reading meta graph with tags { serve }
2020-10-17 01:51:46.912960: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:295] Reading SavedModel debug info (if present) from: /home/dipesh/models/dnn_for_cdssm/1
2020-10-17 01:51:46.916942: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:234] Restoring SavedModel bundle.
2020-10-17 01:51:46.940462: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:183] Running initialization op on SavedModel bundle at path: /home/user/models/dnn_for_cdssm/1
2020-10-17 01:51:46.947514: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:364] SavedModel load for tags { serve }; Status: success: OK. Took 36559 microseconds.
2020-10-17 01:51:46.948348: I tensorflow_serving/servables/tensorflow/saved_model_warmup.cc:105] No warmup data file found at /home/user/models/dnn_for_cdssm/1/assets.extra/tf_serving_warmup_requests
2020-10-17 01:51:46.949083: I tensorflow_serving/core/loader_harness.cc:87] Successfully loaded servable version {name: dnn_for_cdssm version: 1}
2020-10-17 01:51:46.955075: I tensorflow_serving/model_servers/server.cc:355] Running gRPC ModelServer at 0.0.0.0:9002 ...
E1017 01:55:30.274185306 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:55:50.273963581 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:56:10.273677580 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:56:30.273541640 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:56:50.273330934 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:57:05.273176164 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:57:20.273020963 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:57:40.272633395 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E1017 01:57:55.272573695 11400 ssl_transport_security.cc:1285] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
I know, I have asked so many questions but I am completely lost in making the secure connection between my client and TF Server. So I want to cover all the possible reasons that might have gone wrong. Please help me to get this done.
If anyone need any clarification please let me know.
Thanks in advance!!!!
The error comes from the underlying SSL library.
Are you using TLS or mTLS between client and server?
Do you have client side log as well?
I am not familiar with TF parameters, e.g., --pkcs_password_encrypted. gRPC does not support password encrypted keys.

mysql-connector-c++ 8.0 connection refused

I'm using the mysql-connector-c++ 8.0 after getting it working with great difficulty and now the uri I've entered is as their mentioning in the docs but the connection is refused.
What the doc says:
Client cli("user:password#host_name/db_name", ClientOption::POOL_MAX_SIZE, 7);
My Code:
_mysql_client = std::make_unique<mysqlx::Client>("mysqlx://root:asdasd#localhost/asdasd");
try {
mysqlx::Session s = _mysql_client->getSession();
CoreLog->info("Successfully connected to mysql server on {}.", conn_uri);
} catch (const mysqlx::Error &err) {
CoreLog->info("Could not connect to mysql server on {} due to {}.", conn_uri, err.what());
}
and i get this error
[20:34:36.993] Core: Could not connect to mysql server on root:asdasd#localhost/asdasd due to CDK Error: Connection refused (generic:61).
What's the issue here?
mysqlx::Client is for connection to the new Mysql X protocol. This listens on a different port (33060 by default instead of 3306) which is the cause of the "connection refused" message.
You need to install and enable the Mysql protocol X plugin. See https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html for instructions.

handshake error on trying to connect to to node server

I have followed some tutorials and built a chat application using nodejs,socket io and django which works fine locally in ubuntu server running in virtual machine. But, when i try to run this in my live site,hosted on webfaction, i see a 'handshake error'. I have installed nodejs using this tutorial -- http://www.ravelrumba.com/blog/how-to-install-node-js-on-webfaction/
client:
$(document).ready(function(){
var socket = io.connect('http://node.username.webfactional.com');
socket.on('connect',function(){
console.log('connect'); });});
server:
var http = require('http');
var server = http.createServer().listen(30699,'127.0.0.1');
var io = require('socket.io').listen(server);
i get this error in the browser console on trying to connect:
GET http://node.username.webfactional.com/socket.io/1/?t=1378464435111 500 (Internal Server Error)
and a 'handshake error' error in node console.
Any suggestions could be very helpful to me.Thank you.