Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. server {
  2. listen 443 ssl;
  3. server_name myserver.com;
  4. ssl on;
  5.  
  6. ssl_certificate /usr/local/etc/nginx/ssl/myserver.com/fullchain.pem;
  7. ssl_certificate_key /usr/local/etc/nginx/ssl/myserver.com/privkey.pem;
  8.  
  9. ssl_client_certificate /usr/local/etc/nginx/ssl/letsencrypt-CA/DSTRootCAX3.crt;
  10. ssl_verify_client on;
  11.  
  12. location / {
  13. proxy_pass http://127.0.0.1:4433;
  14. }
  15.  
  16. var fs = require('fs');
  17. var https = require('https');
  18. var options = {
  19. hostname: 'myserver.com',
  20. port: 8443,
  21. path: '/',
  22. method: 'GET',
  23. cert: fs.readFileSync('myclient.com/cert.pem'),
  24. key: fs.readFileSync('myclient.com/privkey.pem'),
  25. ca: fs.readFileSync('myclient.com/DSTRootCAX3.crt'),
  26. };
  27. var req = https.request(options, function (res) {
  28. res.on('data', function (data) {
  29. process.stdout.write(data);
  30. });
  31. });
  32. req.end();
  33. req.on('error', function (e) {
  34. console.error(e);
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement