unexpected eof when using openssl - node.js

I am unable to get a basic react app to work using a self signed certificate on a local development server (Linux Mint 21, Linux 5.15.0-46-generic).
I installed node version 18.10. This has npm/npx v 8.19.2
I created a basic react app using
npx create-react-app myapp
I generated certificate and key using openssl. The certificate has been generated with the CN=sandbox.local, so that I'm not using an IP address.
I then start the app, using
HTTPS=true \
HOST=sandbox.local BROWSER=none \
SSL_CRT_FILE=certification/sandbox.local.pem \
SSL_KEY_FILE=certification/sandbox.local.pem \
npm start
This successfully starts the application, informing me that I can browse the application on https://localhost:3000 (or via the IP address on the network).
Attempting to browse from my local machine (also running Linux Mint 21), in firefox I get:
Secure Connection Failed
An error occurred during a connection to sandbox.local:3000. PR_END_OF_FILE_ERROR
In Chromium:
This page isn’t working
sandbox.local didn’t send any data.
ERR_EMPTY_RESPONSE
And using curl,
curl: (35) error:0A000126:SSL routines::unexpected eof while reading
There's a plethora of pages out there telling me that this is something to do with openssl version 3 expecting a response and not getting one. There's nothing that I've been able to find that tells me how to fix that in the context of a react application.
On the same machine I have a dash/plotly application, running with self signed certificates that were generated in exactly the same way. That application is accessible and works, which leads me to wonder if there it's something in the react/node interaction with openssl. I can resolve sandbox.local both with http and https for other types of applications.
The created app is literally the output of create-react-app. If I install and run it on the same machine, it works fine.
Is there some configuration option I'm missing? I haven't been able to generate an error log file from node, so apart from the SSL error from curl, I'm flying blind. Will update if/when I figure out how to log errors.

Related

Getting The SSL connection could not be established error while installing Build Agent on Azure Server

I am trying to install a self-hosted build agent on my azure server and I am unable to install it due to below error,
However, I am able to install it on my other server without any error. I am not sure what am I missing on the server where I am getting the above error.
I had tried using the --sslskipcertvalidation as well but no success. I also created a self signed SSL cert as well by referring the below URL but still the issue exist.
https://thycotic.force.com/support/s/article/Installing-a-Self-Signed-SSL-HTTPS-Certificate

IIS deployment issue

I am running IIS in a standalone Windows Server 2012, and getting a mysterious issue:
I have a webapi (developed with .NET 4.6) which impelement SCEP protocol under the HTTP GET, and the app folder is in C:\inetpub\wwwroot\app\mywebapi.
If I create a virtual directory under Default Web Site,then it works (for instance, http://localhost/app/mywebapi).
Test procedures:
using browsers to surf: http://localhost/app/mywebapi?operation=GetCACert
using sscep (an command line test tool) sscep getca -u http://localhost/app/mywebapi -c ca.crt
Results: Both cases work
if I create a new website, then it does not work in some case (for instance: http://mywebapi) (hosts file has been edited, so it understand mywebapi as a hostname already)
using browsers to surf: http://mywebapi?operation=GetCACert
using sscep (an command line test tool) sscep getca -u
http://mywebapi -c ca.crt
Results:
OK
does not work, IIS returns 404
Does anybody know about this issue?

newman CLI returns "error: unable to get local issuer certificate" in teamcity build

Using the newman nodeJS CLI to run a collection of postman test I get the following error:
error: unable to get local issuer certificate
It is run as part of a Teamcity CI build using the following command:
newman run https://www.getpostman.com/collections/<COLLECTION-ID-HERE>
It is run on windows and we have a corporate proxy server (ZScaler).
How to I get newman to work?
Just add --insecure in front of collectionID i.e :
newman run https://www.getpostman.com/collections/?apiKey="your-Postman-Api-Key" --insecure
Also When triggering the execution using a json file, Just add --insecure So your command shall be :
newman run .postman_collection.json --insecure
The issue is that newman cannot find (or does not know about) the self signed SSL certificate used by the proxy server that is configured in the windows certificate store. The easiest way to make newman (and actually any recent nodeJS app) aware of the certificate is to use an environment variable:
on windows:
SET NODE_EXTRA_CA_CERTS=c:\some-folder\certificate.cer
on linux:
export NODE_EXTRA_CA_CERTS=/c/some-folder/certificate.cer
You may also need to set the proxy server url itself with the HTTP_PROXY=http://example.com:1234 env varirable as well.
Alternatively the environment variables can be added to that teamcity builds runtime environment using the build parameters feature of Teamcity
Note this is for Node.js 7.3.0 and above (and the LTS versions 6.10.0 and 4.8.0)

Node.JS code fails without error on Ubuntu

I have the simplest code for firebase :
var Firebase=require('firebase');
var Ref=new Firebase('http://mydb.firebaseio.com/requests');
Ref.push({name:"checkin",type:"mandatory"},function(response){
console.log(response);
});
and I'm running it with SSH in command line on my Ubuntu 12.04 server. For some reason the push method runs but doesn't push anything and doesn't even show an error. I tried logging the error to a file but the file remains empty. I also tried catching an uncaught exception from the process, no luck. There basically isn't an error to show. How should I catch an error so I can investigate further ?
Extra information :
-Node.JS version installed on the server is 12.4 .
-One thing I noticed is there is no certificate file on the server and for example I can't use curl with an https url or PPA to download a package.
-Ubuntu 12.04.
-When I push to firebase using a PHP script it works fine but nodeJS fails to do it.
-The server is in a hospital's internal network and connects to internet through a proxy. Certain HTTPS websites are allowed on port 80 , the rest are blocked . Some similar policies might be in place for other ports and protocols.

Capifony Error reading response length from authentication socket - linux

I have created a configuration on one machine (ubuntu) that works and checks out code from repo, now I try to duplicate the same configuration on another machine.
I have configured ssh to the point when I can issue:
ssh -Tv git#gihub.com
And I get correct response:
Hi <myrepo>! You've successfully authenticated, but GitHub does not provide shell access.
I can see which key is taken for authentication. I also can checkout code from repo manually.
But when Capifony runs checkout code it ends up with:
Error reading response length from authentication socket.
I have already upgraded net-ssh gem to 2.9.1, tried with ssh-add (although I have forwarding set up in /etc/ssh/ssh_config).
It looks like Capfiony does not see ssh authentication configuration that works from command line, how can it be ?

Resources