Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

Want to setup SSL over OHIF Viewer project for secure connection

Open vishal95713 opened this issue 9 years ago • 5 comments

I am very new to meteor project and not have any idea related to setup ssl over meteor. I had generated my crt file and also have key file. But don't know how to use it on meteor project. I had setup SSL previously on apache or IIS projects, but don't have idea on it. I am running OHIF Viewer on Windows. Kindly help me over this.

vishal95713 avatar Nov 08 '17 06:11 vishal95713

You don't setup SSL over Meteor, you use something like Apache or Nginx in front of Meteor.

Here is an example for Nginx: https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority#install-certificate-on-web-server

Here is an example of deploying a Meteor application behind Nginx:

https://medium.com/startup-founder-panel/deploying-a-meteor-app-with-nginx-from-scratch-1332b32e99a5

Hope that helps!

swederik avatar Nov 08 '17 07:11 swederik

Thanks for your reply swederik, I tried it but its not working.

vishal95713 avatar Nov 08 '17 08:11 vishal95713

You'll need to provide more information than that if you want anyone to be able to help you. What is the problem? Are you getting an error somewhere?

swederik avatar Nov 08 '17 08:11 swederik

Everything is working properly. Steps:-

  1. First I started the meteor app on my domain.com:3000 successfully on ubuntu.
  2. Installed apache2 then edited 000-default file and added the crt files path(not giving any type of error).
  3. Then reload the apache2.
  4. Now when I am running https://domain.com:3000 its showing me site can't be reached. And whenever I run http://domain.com:3000 then its working properly.

vishal95713 avatar Nov 08 '17 09:11 vishal95713

Hi,

I succeed to activate the ssl protocol with the standalone version and python file (redirectingSimpleServer.py).

My file : `import BaseHTTPServer, SimpleHTTPServer, SocketServer import urlparse, os import ssl

PORT = 4443

URL_PATH=""

class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self):

   self.path = self.path.replace(URL_PATH, "")

   parsedParams = urlparse.urlparse(self.path)

   if os.access('.' + os.sep + parsedParams.path, os.R_OK):
      SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self);
   else:
      self.send_response(200)
      self.send_header('Content-Type', 'text/html')
      self.end_headers()
      with open('index.html', 'r') as fin:
        self.copyfile(fin, self.wfile)

Handler = MyHandler

httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler) httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="ssl/server.key", certfile='ssl/webserv.crt', server_side=True)

print "serving at port", PORT httpd.serve_forever() `

IMP360 avatar Dec 19 '17 15:12 IMP360