I'm trying to make simple GET request from my university schedule website. This is the URL https://planzajec.uek.krakow.pl/ and to be exact https://planzajec.uek.krakow.pl/index.php?typ=G&id=190201&okres=1&xml where i get XML of my schedule. So I tried to make simple request as below
const https = require('https');
const request = https.get('https://planzajec.uek.krakow.pl', (result) => {
console.log(result.statusCode);
});
and got error: Error: write EPROTO 80C5F30601000000:error:0A000172:SSL routines:tls12_check_peer_sigalg:wrong signature type:../deps/openssl/openssl/ssl/t1_lib.c:1565:
Although when I try to make this request on https://www.google.com/ or even main page of my university https://uek.krakow.pl/ I got 200 OK, so there is something wrong with the schedule website. After few hours of digging I've found out that the chain of CA is broken there.
https://www.ssllabs.com/ssltest/analyze.html?d=planzajec.uek.krakow.pl
Chain issues: Incomplete
Now I'm trying to pass those CA certs in requests but for some reason it's still not working. (tried both consolidated in one .pem file and passing array of individual .pem files)
const https = require('https');
const consolidate_ca = fs.readFileSync('consolidate.pem');
const request = https.get('https://planzajec.uek.krakow.pl/', { ca:consolidate_ca } , (result) => {
console.log(result.statusCode);
});
Out of curiosity I checked if it works in python.
import requests
r = requests.get('https://planzajec.uek.krakow.pl/', verify='consolidate.pem')
print(r.status_code)
And got 200 OK (without verify parameter I was getting similar error as in JS).
As i have pointed out in the comments. This method is very insecure and there are probably better solutions present on the internet. You can set a env variable to disable ssl and tls completely
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
const https = require('https')
const request = https.get('https://planzajec.uek.krakow.pl/index.php?typ=G&id=190201&okres=1&xml ',async (result) => {
console.log(result.statusCode);
});