Commit 1a6faa7c authored by Vivien Alger's avatar Vivien Alger

Modified generation of certificate

parent 2fabca95
......@@ -165,7 +165,7 @@ class Recipe(BaseSlapRecipe):
noVNC_conf['python_path'] = python_path
noVNC_conf['ca_conf'] = self.installCertificateAuthority()
noVNC_conf['pem_path'] = self.createPem('noVNC')
noVNC_conf['certificate_path'] = self.requestCertificate('noVNC')
# Instanciate Websockify
websockify_runner_path = self.instanciate_wrapper("websockify",
......@@ -311,26 +311,3 @@ class Recipe(BaseSlapRecipe):
)[0]
self.path_list.append(wrapper)
return cron_d
def createPem(self,name):
"""
Create self.pem file for noVNC encryption
Parameters: name for the requestCertificate function
Return: path to self.pem
"""
key, certificate = self.requestCertificate(name)
pem = os.path.join(self.ca_certs, 'self.pem')
pem_file = open(pem, 'w')
key_file = open(key, 'r')
pem_file.write(key_file.read())
key_file.close()
certificate_file = open(certificate, 'r')
pem_file.write(certificate_file.read())
certificate_file.close()
pem_file.close()
return pem
......@@ -43,7 +43,7 @@ class CertificateAuthority:
# no CA, let us create new one
popenCommunicate([self.openssl_binary, 'req', '-nodes', '-config',
self.openssl_configuration, '-new', '-x509', '-extensions',
'v3_ca', '-keyout', self.key, '-out', self.certificate,
'v3_ca', '-keyout', self.certificate, '-out', self.certificate,
'-days', '10950'], 'Automatic Certificate Authority\n')
except:
try:
......
......@@ -2,5 +2,5 @@
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
%(python_path)s %(websockify_path)s --web %(noVNC_location)s --cert=%(pem_path)s --ssl-only %(source_ip)s:%(source_port)s %(target_ip)s:%(target_port)s
%(python_path)s %(websockify_path)s --web %(noVNC_location)s --cert=%(certificate_path)s --ssl-only %(source_ip)s:%(source_port)s %(target_ip)s:%(target_port)s
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment