Questions tagged [node-https]

53 questions
11
votes
2 answers

Socket hang up when using axios.get, but not when using https.get

To the best of my knowledge, I am doing the same thing using 2 different approaches: const https = require("https"); const axios = require("axios"); let httpsAgent = new https.Agent({rejectUnauthorized:…
Lucas
  • 14,227
  • 9
  • 74
  • 124
6
votes
1 answer

Cloudflare 522 error - javascript client connecting to node server

I'm trying to connect to a nodejs https server from a apache web server hosted javascript client and I'm getting an error message : 522 - Failed to load response data: No data found for resource with given indentifier. The apache web server runs on…
Arivan Bastos
  • 1,876
  • 1
  • 20
  • 28
5
votes
1 answer

Trello responds 'invalid key'

I am trying to get JSON data for a Trello board using the following URL, using Node.js's https module: https://trello.com/b/nC8QJJoZ.json Here's my code: var https = require('https'); https.get('https://trello.com/b/nC8QJJoZ.json', function (res)…
sampathsris
  • 21,564
  • 12
  • 71
  • 98
4
votes
2 answers

For of loop to make HTTPS geocoding api call and on result input the coordinates into SQL database, how to get Node's HTTPS module to work?

I have 13.000 documents from MongoDB where I have address line + Postcode, im trying to make a request for each of them to Google's geocoding API and get LAT + LONG for them so I can have them appear dynamically on a map search. I have designed the…
SebastianG
  • 8,563
  • 8
  • 47
  • 111
3
votes
2 answers

Differences between Node standard https and node-fetch when providing a certificate

ADP's REST API requires that a SSL certificate and private key be sent with every request. When I use the 'standard, Node.js HTTP(S) module: require('dotenv').config() const fs = require('fs') const path = require('path') const certificate_path =…
craig
  • 25,664
  • 27
  • 119
  • 205
3
votes
0 answers

How do I create a valid AWS token to make a request to ElasticSearch using a Cognito identity?

I want to make a request to an AWS ElasticSearch instance. The instance has access control to allow access to one or more AWS accounts or IAM users. The role represents a Cognito Identity pool that has a Cognito User Pool as authentication…
user1283776
  • 19,640
  • 49
  • 136
  • 276
2
votes
1 answer

Can't resolve 'node:http

I am doing reactjs project when I tried to run npm start ./node_modules/node-fetch/src/index.js Module not found: Can't resolve 'node:http' in 'C:\Users\Aorat\OneDrive\Desktop\Fam-Jam-Family-Application\client\node_modules\node-fetch\src'
2
votes
1 answer

Result of `req.socket.authorized` is not correct using nodejs https and express [mutual authentication]

I'm trying to set up a https server with mutual authentication. I created the key and the certificate for the server (auto-signed). Now I use firefox to connect to the server without providing any client certificate. This should result in the…
Zanna_37
  • 122
  • 10
2
votes
1 answer

node https-proxy pathRewrite / router

I have two instances of the same node app running on port 3000 and 4000. I would like to have the following behavior: https://localhost/dev ==> http://localhost:3000 https://localhost/prod ==> http:// localhost:4000 I have the following proxy in…
blueren
  • 2,730
  • 4
  • 30
  • 47
2
votes
2 answers

How can I inject a new SSL cert and key into a running Node http.Server?

I am running a secure websocket proxy to a TCP service. This uses a standard http.Server set up like: var webserver = http.createServer( { …
chaos
  • 122,029
  • 33
  • 303
  • 309
2
votes
1 answer

Can't get cookies with HTTP/HTTPS of Nodejs

I try with https.request but when I want access to cookie response, this don't appear on resource headers. HTTP/HTTPS. Example code: let https = require('https'); https.request({ rejectUnauthorized: false, hostname: 'example.com', port:…
Olaf Erlandsen
  • 5,817
  • 9
  • 41
  • 73
2
votes
1 answer

node.js https POST with body-attributes - HOW?

I am trying to get a Token with my node.js server. The code below gets executed when someone calls the REST-API of my server (within the processing of this call the server makes several calls himself). The following configuration works in…
IntegerWolf
  • 1,232
  • 1
  • 11
  • 21
1
vote
1 answer

Am I inserting the .pem certficate correctly in my https.request method?

I'm making a call to an API that requires both a HTTPS Basic Authentication and certification. The cert has a passphrase. This is my config variable: const cert = fs.readFileSync('path.pem'); const config = { method: 'POST', cert: cert, …
1
vote
1 answer

using https.get instead of got causes a 308

this is a difficult question to ask because I am mystified, but let's see… I am comparing Got with https.get, and have the following, bare simple code that works. Both Got and https.get return exactly the same result. But when I use exactly the same…
punkish
  • 13,598
  • 26
  • 66
  • 101
1
vote
0 answers

how do I know that the socket is being re-used for request

I am using nodeJS https.Agent to make a call. I have configured the Agent such a way that it should re-use the socket. How do I know if the same socket being re-used when I make subsequent the call to the same host? I tried req.reusedSocket but…
vikas kv
  • 386
  • 2
  • 15
1
2 3 4