Make LE work with hyphenated domains
This commit is contained in:
44
src/test/acme2-test.js
Normal file
44
src/test/acme2-test.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/* global it:false */
|
||||
/* global describe:false */
|
||||
/* global before:false */
|
||||
/* global after:false */
|
||||
|
||||
'use strict';
|
||||
|
||||
var async = require('async'),
|
||||
config = require('../config.js'),
|
||||
database = require('../database.js'),
|
||||
acme2 = require('../cert/acme2.js'),
|
||||
expect = require('expect.js'),
|
||||
_ = require('underscore');
|
||||
|
||||
describe('Acme2', function () {
|
||||
before(function (done) {
|
||||
config._reset();
|
||||
|
||||
async.series([
|
||||
database.initialize,
|
||||
database._clear
|
||||
], done);
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
async.series([
|
||||
database._clear,
|
||||
database.uninitialize
|
||||
], done);
|
||||
});
|
||||
|
||||
describe('getChallengeSubdomain', function () {
|
||||
it('non-wildcard', function () {
|
||||
expect(acme2._getChallengeSubdomain('example.com', 'example.com')).to.be('_acme-challenge');
|
||||
expect(acme2._getChallengeSubdomain('git.example.com', 'example.com')).to.be('_acme-challenge.git');
|
||||
});
|
||||
|
||||
it('wildcard', function () {
|
||||
expect(acme2._getChallengeSubdomain('*.example.com', 'example.com')).to.be('_acme-challenge');
|
||||
expect(acme2._getChallengeSubdomain('*.git.example.com', 'example.com')).to.be('_acme-challenge.git');
|
||||
expect(acme2._getChallengeSubdomain('*.example.com', 'customer.example.com')).to.be('_acme-challenge'); // for hyphenatedSubdomains
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user