Skip to content

Instantly share code, notes, and snippets.

@Cohee1207
Created April 18, 2024 08:03
Show Gist options
  • Save Cohee1207/10774c05392e1f15f0f5ceac2559e106 to your computer and use it in GitHub Desktop.
Save Cohee1207/10774c05392e1f15f0f5ceac2559e106 to your computer and use it in GitHub Desktop.
const https = require('https');
const options = {
hostname: 'api.novelai.net',
port: 443,
path: '/',
method: 'GET',
};
const req = https.request(options, (res) => {
const cert = res.socket.getPeerCertificate();
console.log(cert);
res.on('data', (data) => {
// Handle response data
console.log(data.toString());
});
});
req.on('error', (error) => {
console.error('An error occurred:', error);
});
req.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment