Guest User

Untitled

a guest
Sep 26th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. const https = require('https');
  2.  
  3. var httpOptions = {
  4. hostname: <URL>,
  5. path: <PATH>,
  6. port:443,
  7. method:"GET",
  8. auth: <USERNAME>+":"+<PASSWORD>
  9. }
  10. console.log(httpOptions);
  11.  
  12. https.get(httpOptions,(res)=>{
  13. console.log('statusCode:', res.statusCode);
  14.  
  15. res.on('data', function (chunk) {
  16. console.log("DATA");
  17. });
  18.  
  19. res.on('end',(error)=>{
  20. console.log("END");
  21. });
  22.  
  23. res.on('error',(error)=>{
  24. console.log("ERRROR");
  25. });
  26.  
  27. });
  28.  
  29. Error: Hostname/IP doesn't match certificate's altnames: "Host: https. is not in the cert's altnames: DNS:*.ng.bluemix.net, DNS:ng.bluemix.net"
Add Comment
Please, Sign In to add comment