답변 1개
채택된 답변
+20 포인트
6년 전
호스팅에서 어렵지 않을까 합니다만,
서버에서는 인증서 발급 받으시고 아래와 같이 사용하시면 됩니다.
PEM 포맷 적용 예제
const https = require('https');
const fs = require('fs');
const options = {
ca: fs.readFileSync('인증서경로/ca-chain-bundle.pem')
key: fs.readFileSync('인증서경로/domain_xxxxx.key.pem')
cert: fs.readFileSync('인증서경로/domain_xxxxx.crt.pem')
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
pfx 포맷 적용 예제
const https = require('https');
const fs = require('fs');
const options = {
pfx: fs.readFileSync('인증서경로/domain_xxxxx.pfx')
passphrase: 'pfx 패스워드 지정'
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
하틴
6년 전
오오..감사합니다! ㅎㅎ
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인