mirror of
				https://github.com/therootcompany/greenlock-express.js.git
				synced 2024-11-16 17:28:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			532 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			532 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| module.exports.create = function (opts) {
 | |
| 
 | |
|   opts.workerSniCallback = require('le-sni-auto').create({
 | |
|     getCertificates: function (domain, certs, cb) {
 | |
|       opts.approveDomains(domain, certs, function (err, certs) {
 | |
|         process.send({ type: 'LE_REQUEST', domain: domain, options: { domains: [domain] } certs: certs });
 | |
| 
 | |
|         process.on('message', function (msg) {
 | |
|           if (msg.domain === domain) {
 | |
|             cb(msg.certs);
 | |
|           }
 | |
|         });
 | |
|       });
 | |
|     }
 | |
|   }).sniCallback;
 | |
| 
 | |
|   return opts;
 | |
| };
 |