HTTPS connection error on MAMP server - https

I have setup a MAMP server and configured an SSL site. I have verified it works with a call (https://app.dev:8890/login/hello.html) to a simple html file.
i found a test app that woks and connects to a remote server with no issues.
I modified the app to connect using my local MAMP server....
let url:NSURL = NSURL(string: "https://app.dev:8890/login/jsonsignup.php")!
when I run it and try getting to that page I receive this error....
2015-09-04 13:04:19.679 SwiftLoginScreen[14905:437125] PostData: username=uname&password=pword&c_password=pword
2015-09-04 13:04:19.693 SwiftLoginScreen[14905:441196] CFNetwork SSLHandshake failed (-9824)
2015-09-04 13:04:19.695 SwiftLoginScreen[14905:441196] CFNetwork SSLHandshake failed (-9824)
2015-09-04 13:04:19.697 SwiftLoginScreen[14905:441196] CFNetwork SSLHandshake failed (-9824)
2015-09-04 13:04:19.697 SwiftLoginScreen[14905:441196] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
I do not want to disable ATS I just need to see where my issue is with this connection.

Related

Bug CleverBeagle Pup 2.0 Meteor GraphQL deployment on Heroku

1) In the first time, when I deployed the origin code to heroku server with git clone https://github.com/cleverbeagle/pup
The launching application didn't work.
I managed to correct this with to copy the content of 'settings-development.json' file and paste in Heroku => myProject => Setttings => Reveal Config Vars => Key : METEOR_SETTINGS and Value : I pasted here the content.
thanks to :
- https://github.com/cleverbeagle/pup/issues/9
- https://github.com/cleverbeagle/pup/issues/197
So, now, the app is showing on server.
2) On Chrome console, I have this error :
50d72c91808ef7fba57f920b67d152d2d57698eb.js?meteor_js_resource=true:9 WebSocket connection to 'ws://localhost:4001/graphql' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
so I changed this in METEOR_SETTINGS
"graphQL": {
"httpUri": "http://localhost:3000/graphql",
"wsUri": "ws://localhost:4001/graphql"
},
to
"graphQL": {
"httpUri": "https://myproject.herokuapp.com:3000/graphql",
"wsUri": "wss://myproject.herokuapp.com:4001/graphql"
},
Note without https and wss, the app is not showing
3) Now on Chrome Console, I have :
this warning :
50d72c91808ef7fba57f920b67d152d2d57698eb.js?meteor_js_resource=true:9 WebSocket connection to 'wss://myproject.herokuapp.com:4001/graphql' failed: WebSocket is closed before the connection is established.
and after several warning above, I have this error :
50d72c91808ef7fba57f920b67d152d2d57698eb.js?meteor_js_resource=true:9 WebSocket connection to 'wss://myproject.herokuapp.com:4001/graphql' failed: WebSocket opening handshake timed out
By using the origin source code from Pup, I can signup on server but I cannot create a new document.
Any help, please ?
Thank you
EDIT 15 JAN 2019
**4) I remove Port like this : **
"httpUri": "https://myproject.herokuapp.com/graphql",
"wsUri": "wss://myproject.herokuapp.com/graphql"
Now, I can create New document on https://myproject.herokuapp.com/documents
but I still have this warning :
fe6fa1ac83e19aa2513ac3f97293600e8dc99e8e.js?meteor_js_resource=true:9
WebSocket connection to 'wss://myproject.herokuapp.com/graphql'
failed: WebSocket is closed before the connection is established.
and this error :
WebSocket connection to 'wss://myproject.herokuapp.com/graphql'
failed: Error during WebSocket handshake: Unexpected response code:
503
any idea ?
Thanks

Configuring the REST server with a persistent data store

I am having problems trying to deploy the rest server with persistence storage (mongo db) I ge this message when deploying the rest server:
docker logs -f rest
[2018-03-12 00:01:13] PM2 log: Launching in no daemon mode
[2018-03-12 00:01:14] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-03-12 00:01:14] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query business network. Error: REQUEST_TIMEOUT
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query business network. Error: REQUEST_TIMEOUT
Error: Error trying to ping. Error: Error trying to query business network. Error: REQUEST_TIMEOUT
at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:699:34)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
[2018-03-12 00:07:03] PM2 log: App [composer-rest-server] with id [0] and pid [14], exited with code [1] via signal [SIGINT]
I am using composer v.18
is there any work around to fix this error. when I run the composer-rest- server alone it work. but if I try to add the mongodb it does not work

Websocket with apache mod_proxy_wstunnel doesn't work

I have made a good preparation: Apache 2.4 + PHP7 + WebSocket
Visit this link to see my preparation
details: Cannot load modules/mod_proxy_wstunnel.so into server
But when I run a simple WebSocket demo, I am meet with some problems. I have no idea how to solve them.
Websocket is a new concept to me. I have learned that Apache 2.4 supports WebSockets with mod_proxy_wstunnel.so.
My steps:
Edit httpd.conf, load mod_proxy and mod_proxy_wstunnel (of course both are in apachedir/modules)
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
Add proxy (still in httpd)
ProxyPass /ws ws://10.180.0.123/
ProxyPassReverse /ws ws://10.180.0.123/
create HTML client and PHP server (cd apachedir/htdocs)
client.html
<html>
<script>
var socket = new WebSocket("ws://10.180.0.123/server.php");
socket.onopen = function(e){
console.log("open success");
}
socket.onmessage = function(e){
console.log("mes:"+e);
}
//socket.close();
socket.send("Hello World");
</script>
<html>
server.php
<?php
echo "hello";
?>
4.start apache
/usr/local/apache2/bin/apachectl start
My questions:
When I open: 10.180.0.123/client.html, I got the following error:
Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
WebSocket connection to 'ws://10.180.0.123/server.php' failed: Error during WebSocket handshake: Unexpected response code: 200
I guess I should write some code in server.php, and run it. Am I right? And what should I write. I didn't find any information on google.
When I open: 10.180.0.123/ws/client.html, I get the following Apache error logs
[Wed Sep 28 00:14:54.063989 2016] [proxy:warn] [pid 6646:tid 140326217934592] [client 10.230.0.93:57508] AH01144: No protocol handler was valid for the URL /ws/client.html. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
It seems the proxy module was not be loaded, but see my screenshot:
A PHP script returning "hello" is not a WebSocket server.
You need to run an actual WebSocket server and point your proxy configuration to it.
Look into Ratchet for a PHP based WebSocket server.
When you have the WebSocket server running, you need to setup your Apache config.
Assuming it runs on the same machine and on port 8080:
ProxyPass /ws ws://localhost:8080/
ProxyPassReverse /ws ws://localhost:8080/
And inside your client.html, you should connect your WebSocket to ws://10.180.0.123/ws.

NSLogger Viewer

is NSLogger Viewer working for anyone? I'm running Xcode8b6 and can't get any of the sample files to actually log something into the app.
I even rebuild NSLoggerViewer from scratch and when running it in the debug mode, it reports following issue:
2016-08-28 21:13:51.208393 NSLogger[32974:1208999] CFNetwork SSLHandshake failed (-9806)
2016-08-28 21:13:51.208580 NSLogger[32974:1208999] Stream error occurred: stream=<__NSCFInputStream: 0x6180001046e0> self=<LoggerNativeTransport 0x600000083390 listenerPort=63262 publishBonjourService=1 secure=1> error=Error Domain=NSOSStatusErrorDomain Code=-9806 " : t" UserInfo={_kCFStreamErrorCodeKey=4294957490, _kCFStreamErrorDomainKey=3}
2016-08-28 21:14:48.142366 NSLogger[32974:1208999] incoming connection
2016-08-28 21:14:48.143200 NSLogger[32974:1208999] setupSSLForStream, stream=<__NSCFInputStream: 0x610000104ec0> self=<LoggerNativeTransport 0x600000083390 listenerPort=63262 publishBonjourService=1 secure=1> serverCerts=(
"<SecIdentity 0x608000269440 [0x7fffe148cbd0]>",
"<cert(0x1005884d0) s: NSLogger self-signed SSL i: NSLogger self-signed SSL>"
)
Does anyone have any idea what's going on here?

Socket.IO flashsocket security sandbox error

I have been playing around with node.js and socket.io for the past few days. Everything works fine on my local machine (windows using iss for a webserver), but when uploading it to my remote server (ubuntu box), I get security errors.
[trace] Warning: Failed to load policy file from http://localhost:8000/crossdomain.xml
[trace] *** Security Sandbox Violation ***
[trace] Connection to http://localhost:8000/socket.io/1/ halted - not permitted from http://****/virtualcinema/VirtualCinema.swf
[trace] Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://****/virtualcinema/VirtualCinema.swf cannot load data from http://localhost:8000/socket.io/1/.
The AS3 code it's erroring on is:
Security.loadPolicyFile("xmlsocket://localhost:10843");
socket = new FlashSocket("localhost:8000");
The policy file is being served correctly on port 10843 and I can receive the policy file fine at http://**:10843/ in my browser. Why is it trying to load the policy file on port 8000. That warning does not appear on my local build.
The socket.io code:
socket = io.listen(8000);
socket.configure(function()
{
socket.set("transports", ["flashsocket"]);
socket.set("log level", 2);
});
I'm confused as to why it gets resolved fine when I test it on a localmachine but not on a remote one. Any help would be much appreciated :)
The crossdomain.xml I am using:
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
Fixed. I changed it from pointing to localhost to my servers externalIP.
I had tried this before, but unfortunately the server had cached my swf file and I did not realise it was fixed.
Security.loadPolicyFile("xmlsocket://****.com:10843");
socket = new FlashSocket("****.com:8000");

Resources