Skip to main content

FastSSL - SSL证书签发SDK,支持申请、验证和获取SSL证书

Project description

FastSSL

FastSSL 是一个用于管理SSL证书的Python SDK,支持申请、验证和获取SSL证书。

签发密钥获取渠道:ssl.aa1.cn/user/

开发者:沈阳明心科技有限公司

联系方式

EMail:15001904@qq.com

安装

pip install fastssl

快速开始

from fastssl import FastSSLClient

# 初始化客户端
client = FastSSLClient(api_key="your_api_key")

# 申请SSL证书
result = client.create_certificate(
    certificate_domain="example.com",
    channel_type="zerossl",  # 可选: zerossl, letsencrypt, google
    validation_method="DNS"  # 可选TXT文件验证 FILE_HTTP
)

# 验证域名
verify_result = client.verify_domain(domain="example.com")

# 获取证书信息
cert_info = client.get_certificate_info(domain="example.com")

# 一键申请并验证(便捷方法)
full_result = client.create_and_verify(
    certificate_domain="example.com",
    channel_type="zerossl"
)

API 文档

FastSSLClient

__init__(api_key: str)

初始化FastSSL客户端。

参数:

  • api_key: API密钥

create_certificate(certificate_domain: str, channel_type: str = "zerossl", validation_method: str = "DNS")

申请SSL证书。

参数:

  • certificate_domain: 需要验证的域名
  • channel_type: 证书品牌,可选值: zerossl, letsencrypt, google
  • validation_method: 验证方式,默认为 DNS(API统一使用DNS,但实际DNS记录类型不同:
    • zerossl 使用 CNAME 记录
    • letsencrypt/google 使用 TXT 记录)

返回: 包含证书申请结果的字典

verify_domain(domain: str, max_retries: int = 10, retry_interval: int = 5)

验证域名并等待证书签发完成。如果验证成功但download_url为空,会自动重试。

参数:

  • domain: 要验证的域名
  • max_retries: 最大重试次数(当download_url为空时)
  • retry_interval: 重试间隔(秒)

返回: 包含验证结果的字典

get_certificate_info(domain: str)

获取证书信息,自动处理证书内容中的换行符。

参数:

  • domain: 域名

返回: 包含证书信息的字典

create_and_verify(certificate_domain: str, channel_type: str = "zerossl", validation_method: str = "DNS", max_retries: int = 10, retry_interval: int = 5)

一键申请并验证证书的便捷方法。

参数:

  • certificate_domain: 需要验证的域名
  • channel_type: 证书品牌
  • validation_method: 验证方式,默认为 DNS
  • max_retries: 验证最大重试次数
  • retry_interval: 重试间隔(秒)

返回: 包含完整流程结果的字典

示例

基本使用

from fastssl import FastSSLClient

client = FastSSLClient(api_key="your_api_key")

# 申请证书
create_result = client.create_certificate(
    certificate_domain="example.com",
    channel_type="zerossl"
)

if create_result.get("success"):
    print("证书申请成功!")
    print(f"验证信息: {create_result.get('data', {}).get('verify_info')}")
    
    # 验证域名
    verify_result = client.verify_domain("example.com")
    
    if verify_result.get("success"):
        print("证书验证成功!")
        print(f"下载地址: {verify_result.get('data', {}).get('download_url')}")
        
        # 获取证书信息
        cert_info = client.get_certificate_info("example.com")
        if cert_info.get("success"):
            print("证书内容:")
            print(cert_info.get("data", {}).get("crt_pem"))

一键申请并验证

from fastssl import FastSSLClient

client = FastSSLClient(api_key="your_api_key")

result = client.create_and_verify(
    certificate_domain="example.com",
    channel_type="zerossl",
    max_retries=15,  # 最多重试15次
    retry_interval=10  # 每次间隔10秒
)

if result.get("success"):
    verify_data = result.get("verify_result", {}).get("data", {})
    print(f"证书编号: {verify_data.get('certificate_no')}")
    print(f"下载地址: {verify_data.get('download_url')}")

许可证

MIT License

支持

如有问题或建议,请提交Issue。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastssl-0.1.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastssl-0.1.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file fastssl-0.1.2.tar.gz.

File metadata

  • Download URL: fastssl-0.1.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for fastssl-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1c7a1b0f37a274e9cf019476b3578b06879a0b2956fbe660cc2bc9228fa668a4
MD5 028cdd8d17d8156fc6836f748ff8945f
BLAKE2b-256 b4f8a9700f2b967973438a7a8f67e1cd2abfade31189a32003da197ce0557f85

See more details on using hashes here.

File details

Details for the file fastssl-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fastssl-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for fastssl-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 39c785f33ef64953efb9a3a003f75caf11833b8320ff39a8580bfda49bcf5fc0
MD5 09aed1b8627a61be9a925081257e50b8
BLAKE2b-256 a77da10d03273756b835a60d2adf1e4f47a04095e2f63f8c574e54453be137de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page