butlerx
					
					6 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B37CA765BAA89170
						
					
				
			
		
		
		
	
		
			
				 2 changed files with 
2 additions and 
2 deletions
			 
			
		 
		
			
				- 
					
					
					 
					package.json
				
 
			
				- 
					
					
					 
					src/server/ssl.ts
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					@ -1,6 +1,6 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  "name": "wetty", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  "version": "1.1.6", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  "version": "1.1.7", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  "description": "WeTTY = Web + TTY. Terminal access in browser over http/https", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  "homepage": "https://github.com/krishnasrinivas/wetty", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  "repository": { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -4,7 +4,7 @@ import { isUndefined } from 'lodash'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { SSL, SSLBuffer } from './interfaces'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					export default async function loadSSL(ssl: SSL): Promise<SSLBuffer> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  if (isUndefined(ssl.key) || isUndefined(ssl.cert)) return {}; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  if (isUndefined(ssl) || isUndefined(ssl.key) || isUndefined(ssl.cert)) return {}; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  const files = [readFile(resolve(ssl.key)), readFile(resolve(ssl.cert))]; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  const [key, cert]: Buffer[] = await Promise.all(files); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  return { key, cert }; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |