Files
certd/packages/core/acme-client/src/index.js
T

76 lines
1.7 KiB
JavaScript
Raw Normal View History

/**
* acme-client
*/
2024-11-12 12:15:06 +08:00
import AcmeClinet from './client.js'
export const Client = AcmeClinet
/**
* Directory URLs
*/
2024-11-12 12:15:06 +08:00
export const directory = {
buypass: {
staging: 'https://api.test4.buypass.no/acme/directory',
production: 'https://api.buypass.com/acme/directory',
},
google: {
staging: 'https://dv.acme-v02.test-api.pki.goog/directory',
production: 'https://dv.acme-v02.api.pki.goog/directory',
},
letsencrypt: {
staging: 'https://acme-staging-v02.api.letsencrypt.org/directory',
production: 'https://acme-v02.api.letsencrypt.org/directory',
},
letsencrypt_staging: {
production: 'https://acme-staging-v02.api.letsencrypt.org/directory',
},
zerossl: {
2024-07-04 01:14:09 +08:00
staging: 'https://acme.zerossl.com/v2/DV90',
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-09-04 23:42:03 +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
}
/**
* 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'
/**
* Axios
*/
2024-11-12 12:15:06 +08:00
export * from './axios.js'
/**
* Logger
*/
2024-11-12 12:15:06 +08:00
export * from './logger.js'
export * from './verify.js'
export * from './error.js'
export * from './util.js'