이전 목록 다음
채택완료

카페24 node.js호스팅에 ssl을 적용할 수 있나요?

카페24에 보니까

 

인증서 미지원

  • 쇼핑몰 호스팅 / 빌더호스팅은 무료 인증서를 지원하므로 별도로 인증서를 구매할 필요가 없습니다.
  • node.js 호스팅은 인증서 설치를 지원하지 않습니다.

 

이렇게 나와있던데 개인적으로 설치할 수 있나요?

 

아니면 설치해보신 분있으신가요?

답변 1개 / 댓글 1개

채택된 답변
+20 포인트

호스팅에서 어렵지 않을까 합니다만,

서버에서는 인증서 발급 받으시고 아래와 같이 사용하시면 됩니다.

 

PEM 포맷 적용 예제

Copy
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 포맷 적용 예제

Copy
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개

오오..감사합니다! ㅎㅎ

답변을 작성하려면 로그인이 필요합니다.