fitbit Oauth ssl connection error - oauth

I've moved my server with another provider, my app was working without issue until I made the migration, now everytime I try to connect with fitbit I get this error:
Fatal error: Uncaught exception 'OAuthException' with message 'making the request failed (SSL connect error)' in /var/www/html/includes/fitbitphp.php:188 Stack trace: #0 /var/www/html/includes/fitbitphp.php(188): OAuth->getRequestToken('https://api.fit...', 'https://gtefina...') #1 /var/www/html/fitbit.php(26): FitBitPHP->initSession('https://gtefina...') #2 {main} thrown in /var/www/html/includes/fitbitphp.php on line 188
I'm using this class as a wrapper https://github.com/heyitspavel/fitbitphp
I've been looking around in several configs of the server but I ran out of options, any idea?
thank you.

You most likely need to update your root CA (Certification Authority) on your new web server.

Related

HyperLedger Fabric and Docker Swarm: Handshake failed with fatal error SSL_ERROR_SSL

We are trying to establish a grpcs (TLS) connection between a docker container running API server (based on Node.js) and another docker container running peer0 from Fabric network.
All containers are orchestated by docker swarm, and both containers happen to be running on the same Linux host.
The error log thrown by API container is the following:
2021-01-07T18:27:38.110Z - error: [Remote.js]: Error: Failed to
connect before the deadline URL:grpcs://10.0.1.2:9051 Query has
completed, checking results error from query = { Error: Failed to
connect before the deadline URL:grpcs://10.0.1.2:9051
at checkState (/usr/src/app/node_modules/grpc/src/client.js:833:16) connectFailed:
true } sampleEvent ERROR : Error: 14 UNAVAILABLE: Connect Failed E0107
18:27:53.602719124 16 ssl_transport_security.cc:1229] Handshake
failed with fatal error SSL_ERROR_SSL: error:14090086:SSL
routines:ssl3_get_server_certificate:certificate verify failed.
And the error log thrown from peer0 is:
2021-01-07 18:50:22.224 UTC [core.comm] ServerHandshake -> ERRO 043 TLS handshake failed with error EOF server=PeerServer remoteaddress=10.0.1.4:46212
IP addresses layout
IP address for API container is 10.0.1.94
IP address for peer0 container is 10.0.1.3
virtual IP address for docker service peer0 is 10.0.1.2
IP address for docker swarm load balancer endpoint is 10.0.1.4
Any suggestion of where to further troubleshoot? At this point is not clear if the problem is with the docker swarm internal networking, or an issue with ssl certificates in either side of the network.
UPDATE Feb 2 2021
The original TLS handshake error was fixed by upgrading the javascript used in NodeSDK. Among other things we started using the addToWallet.js script contained in the commercial-paper example
After being able to stablish TLS succesfully between Node.js API and peer0, we get a new access denied error when making a simple query to chaincode_example02
Facts:
We are running the query with 2 Admin users
One Admin is first-network original Admin#org1.example.com, with credentials generated by cryptogen tool
The other Admin is Admin#buyer.dlt.com whose credentials were created with openssl and a self signed in-company CA
From CLI, both Admin are good and are allowed to run peer commands interchangeably
From Node.js app, only Admin#org1.example.com is allowed to run queries. The message printed to console.log is:
Transaction has been evaluated, result is: 100
When running queries with Admin#buyer.dlt.com we get the following error logs:
Error logs from peer0#buyer.dlt.com
2021-02-02T04:08:45.291086617Z ^[[36m2021-02-02 04:08:45.290 UTC [protoutils] checkSignatureFromCreator -> DEBU 6e637^[[0m creator is &{BuyerMSP 8b7cc2ee996be4f7e5dbb1a4f64db67afd2ff8a2f41276c9bd7f33a2447dd9df}
2021-02-02T04:08:45.291094817Z ^[[36m2021-02-02 04:08:45.290 UTC [protoutils] checkSignatureFromCreator -> DEBU 6e638^[[0m creator is valid
2021-02-02T04:08:45.291100418Z ^[[36m2021-02-02 04:08:45.290 UTC [msp.identity] 2021-02-02T04:08:45.303821799Z ^[[33m2021-02-02 04:08:45.303 UTC [protoutils] ValidateProposalMessage -> WARN 6e63b^[[0m channel [mychannel]: creator's signature over the proposal is not valid: The signature is invalid
2021-02-02T04:08:45.303891604Z ^[[36m2021-02-02 04:08:45.303 UTC [endorser] func1 -> DEBU 6e63c^[[0m Exit: request from 10.0.1.84:52696
2021-02-02T04:08:45.303902005Z ^[[34m2021-02-02 04:08:45.303 UTC [comm.grpc.server] 1 -> INFO 6e63d^[[0m unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=10.0.1.84:52696 error="access denied: channel [mychannel] creator org [BuyerMSP]" grpc.code=Unknown grpc.call_duration=13.783655ms
Error log on console.log from script query.js:
2021-02-02T04:08:45.305Z - error: [Channel.js]: Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [BuyerMSP]
2021-02-02T04:08:45.307Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [BuyerMSP]
Failed to evaluate transaction: Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [BuyerMSP]
In the end, this issue turned out to be two issues, in a 'russian doll like' style.
1. First issue: TLS Handshake error
This was fixed by upgrading the SDK library to the latest release
2. Second issue: Node SDK query triggers error "The signature is invalid".
The reason turned out to be that the CLI (written on Go) is using the Go crypto support which allows it to generate a signature from a hash without any knowledge of the curve used for the key. Instead, the SDK libraries used by the Node implementation require a specific curve to be specified by the code generating the signature, separately from the private key itself.
Bottom line, private keys used within Node SDK should be P-256.
As an alternative, as suggested by hyperledger dev team:
If you really must use a curve other than P-256 then you might be able
to use one of the following approaches:
-Use the off-line signing approach included in the documentation but specify an alternative curve instead of 'p256'. The supported curves
for the elliptic package documented here:
https://github.com/indutny/elliptic
-Set your own CryptoSuite implementation on the Client that underpins the Gateway object, with your own CryptoSuite.sign() implementation:
https://hyperledger.github.io/fabric-sdk-node/release-2.2/CryptoSuite.html#sign

Error Domain=NSURLErrorDomain Code=-1003 : A server with the specified hostname could not be found error

I have an app where I am calling one web service which works fine for the first time but for second time didFailWithError gets called with error
"A server with the specified hostname could not be found."
And also a weird error like
dnssd_clientstub deliver_request: socketpair failed 24 (Too many open files). nw_resolver_create_dns_service_on_queue DNSServiceGetAddrInfo failed: Unknown(-65537)
I don't think it is a network issue. How can I fix it?

deisctl list command raises a timeout error what am I doing wrong

help in "deisctl list" I have just started with deis and am following the tutorial of using deis in vagrant
am stuck at the part am doing deisctl list am getting this as the output
INFO client.go:291: Failed getting response from http://127.0.0.1:4001/: ssh: rejected: connect failed (Connection refused)
Error: timeout reached
Your DEISCTL_TUNNEL value is either incorrect or unreachable due to networking/routing/firewall, etc...

Apache with passenger gives error(Premature end of script headers) in development mode

I'm using Apache + passenger for my rails application, The application is running fine in production mode except when the browser displays error message after every 2-3 clicks in development mode which goes off when i refresh the page.I'm using metal in my rails application which i see could be the reason but not sure if it is the only reason.
Error message on browser:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.16 (Ubuntu) Server at localhost Port 80
Apache log Error:
[Thu Dec 01 16:55:23 2011] [error] [client 127.0.0.1] Premature end of script headers: view_transactions, referer: http://localhost/admin_portal/1014978061/view_transactions
[ pid=660 thr=3078097552 file=ext/apache2/Hooks.cpp:822 time=2011-12-01 16:55:23.563 ]: The backend application (process 796) did not send a valid HTTP response; instead, it sent nothing at all. It is possible that it has crashed; please check whether there are crashing bugs in this application.
[ pid=796 thr=-608495398 file=utils.rb:176 time=2011-12-01 11:25:23.878 ]: *** Exception NoMethodError in application (undefined method `new' for Rails:Module) (process 796, thread #<Thread:0xb77631b4>):
from /home/brijendra/aptana_studio_3_workspace/wantsa/vendor/plugins/newrelic_rpm/lib/new_relic/control.rb:467:in `new_instance'
from /home/brijendra/aptana_studio_3_workspace/wantsa/vendor/plugins/newrelic_rpm/lib/new_relic/control.rb:54:in `instance'
from /home/brijendra/aptana_studio_3_workspace/wantsa/vendor/plugins/newrelic_rpm/lib/new_relic/agent.rb:167:in `logger'
I would be eager to post any other output if required and also suggestions to fix this issue.
I fixed this error by changing cache as true in my development.rb and it worked fine.

Nginx + Passenger - Uncaught exception in PassengerServer client thread

I've installed Passenger with Nginx for testing here and I keep getting this error after some thousand requests:
[ pid=57259 thr=0x40f07780 file=ext/nginx/HelperAgent.cpp:576 time=2010-12-15 14:04:25.876 ]: Uncaught exception in PassengerServer client thread:
exception: write() failed: Socket is not connected (57)
backtrace:
in 'void Client::forwardResponse(Passenger::SessionPtr&, Passenger::FileDescriptor&)' (HelperAgent.cpp:368)
in 'void Client::handleRequest(Passenger::FileDescriptor&)' (HelperAgent.cpp:502)
in 'void Client::threadMain()' (HelperAgent.cpp:595)
[ pid=57259 thr=0x40f07080 file=ext/nginx/HelperAgent.cpp:566 time=2010-12-15 14:04:26.416 ]: Couldn't forward the HTTP response back to the HTTP client: It seems the user clicked on the 'Stop' button in his browser.
I have 2 servers, and I was running haproxy+apache+mongrel on them, I switched one of them for haproxy+nginx+passenger (haproxy is only a backup for my testing, so I can redirect to the old schema quickly in case of fire).
So I noticed that my passenger dies after this message.
Im using ruby-ee 1.8.7, rails 2.3.5 and FreeBSD.
That turns out to be a FreeBSD kernel bug. We're slowly putting more workarounds in the Phusion Passenger codebase to work around this.

Resources