2026-05-05 19:17:44 +08:00
|
|
|
// @ts-nocheck
|
2023-01-29 15:27:11 +08:00
|
|
|
/**
|
|
|
|
|
* acme-client
|
|
|
|
|
*/
|
2026-05-05 19:17:44 +08:00
|
|
|
export { default as Client } from './client.js'
|
|
|
|
|
export type * from './types.js'
|
2023-01-29 15:27:11 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Directory URLs
|
|
|
|
|
*/
|
|
|
|
|
|
2024-11-12 12:15:06 +08:00
|
|
|
export const directory = {
|
2023-01-29 15:27:11 +08:00
|
|
|
buypass: {
|
|
|
|
|
staging: 'https://api.test4.buypass.no/acme/directory',
|
2024-05-22 19:24:07 +00:00
|
|
|
production: 'https://api.buypass.com/acme/directory',
|
2023-01-29 15:27:11 +08:00
|
|
|
},
|
2024-07-15 19:24:17 +00:00
|
|
|
google: {
|
|
|
|
|
staging: 'https://dv.acme-v02.test-api.pki.goog/directory',
|
|
|
|
|
production: 'https://dv.acme-v02.api.pki.goog/directory',
|
|
|
|
|
},
|
2023-01-29 15:27:11 +08:00
|
|
|
letsencrypt: {
|
|
|
|
|
staging: 'https://acme-staging-v02.api.letsencrypt.org/directory',
|
2024-05-22 19:24:07 +00:00
|
|
|
production: 'https://acme-v02.api.letsencrypt.org/directory',
|
2023-01-29 15:27:11 +08:00
|
|
|
},
|
2025-11-11 00:32:43 +08:00
|
|
|
letsencrypt_staging: {
|
|
|
|
|
production: 'https://acme-staging-v02.api.letsencrypt.org/directory',
|
|
|
|
|
},
|
2023-01-29 15:27:11 +08:00
|
|
|
zerossl: {
|
2024-07-04 01:14:09 +08:00
|
|
|
staging: 'https://acme.zerossl.com/v2/DV90',
|
2024-05-22 19:24:07 +00:00
|
|
|
production: 'https://acme.zerossl.com/v2/DV90',
|
|
|
|
|
},
|
2025-09-04 23:42:03 +08:00
|
|
|
sslcom:{
|
|
|
|
|
staging: 'https://acme.ssl.com/sslcom-dv-rsa',
|
|
|
|
|
production: 'https://acme.ssl.com/sslcom-dv-rsa',
|
2025-11-24 23:33:25 +08:00
|
|
|
ec: 'https://acme.ssl.com/sslcom-dv-ecc',
|
2025-11-30 01:30:47 +08:00
|
|
|
},
|
|
|
|
|
litessl: {
|
|
|
|
|
staging: 'https://acme.litessl.com/acme/v2/directory',
|
|
|
|
|
production: 'https://acme.litessl.com/acme/v2/directory',
|
|
|
|
|
},
|
2023-01-29 15:27:11 +08:00
|
|
|
};
|
|
|
|
|
|
2025-11-24 23:33:25 +08:00
|
|
|
export function getDirectoryUrl(opts) {
|
|
|
|
|
const {sslProvider, pkType} = opts
|
|
|
|
|
const list= directory[sslProvider]
|
|
|
|
|
if (!list) {
|
|
|
|
|
throw new Error(`sslProvider ${sslProvider} not found`)
|
|
|
|
|
}
|
2025-11-24 23:43:14 +08:00
|
|
|
let pkTypePrefix = pkType || 'rsa'
|
2025-11-24 23:33:25 +08:00
|
|
|
if (pkType) {
|
2025-11-24 23:43:14 +08:00
|
|
|
pkTypePrefix = pkType.toLowerCase().split("_")[0]
|
2025-11-24 23:33:25 +08:00
|
|
|
}
|
|
|
|
|
|
2025-11-24 23:43:14 +08:00
|
|
|
if (pkTypePrefix && list[pkTypePrefix]) {
|
|
|
|
|
return list[pkTypePrefix]
|
2025-11-24 23:33:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return list.production
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-07 02:20:27 +08:00
|
|
|
|
|
|
|
|
export function getAllSslProviderDomains() {
|
|
|
|
|
const list = Object.values(directory).map((item) => {
|
|
|
|
|
let url = item.production.replace('https://', '')
|
|
|
|
|
url = url.substring(0, url.indexOf('/'))
|
|
|
|
|
return url
|
|
|
|
|
})
|
|
|
|
|
return list
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let sslProviderReverseProxies = {}
|
|
|
|
|
|
|
|
|
|
function initSslProviderReverseProxies() {
|
|
|
|
|
for (const sslProvider of getAllSslProviderDomains()) {
|
|
|
|
|
sslProviderReverseProxies[sslProvider] = ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
initSslProviderReverseProxies()
|
|
|
|
|
|
|
|
|
|
export function getSslProviderReverseProxies() {
|
|
|
|
|
return sslProviderReverseProxies
|
|
|
|
|
}
|
|
|
|
|
export function setSslProviderReverseProxies(reverseProxies) {
|
|
|
|
|
Object.assign(sslProviderReverseProxies, reverseProxies)
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-29 15:27:11 +08:00
|
|
|
/**
|
|
|
|
|
* Crypto
|
|
|
|
|
*/
|
|
|
|
|
|
2024-11-12 12:15:06 +08:00
|
|
|
export * as crypto from './crypto/index.js'
|
2024-11-12 12:25:20 +08:00
|
|
|
export * as forge from './crypto/forge.js'
|
2023-01-29 15:27:11 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Axios
|
|
|
|
|
*/
|
|
|
|
|
|
2024-11-12 12:15:06 +08:00
|
|
|
export * from './axios.js'
|
2023-01-29 15:27:11 +08:00
|
|
|
/**
|
|
|
|
|
* Logger
|
|
|
|
|
*/
|
|
|
|
|
|
2024-11-12 12:15:06 +08:00
|
|
|
export * from './logger.js'
|
|
|
|
|
export * from './verify.js'
|
|
|
|
|
export * from './error.js'
|
2025-04-24 11:54:54 +08:00
|
|
|
|
2026-05-05 19:17:44 +08:00
|
|
|
export * from './util.js'
|