Skip to content
Smarter by Design.Simpler for Business

lb certificate ​

The lb certificate command manages the server certificates that the vServices present. A certificate can come in five ways: it is taken automatically with ACME, it is uploaded by hand, it is imported from a PFX file, it is signed by an external CA with a request created on the device, or it is created with the internal CA of TR7 itself. Its panel equivalent is the SSL/TLS Certificates screen.

Command Summary ​

TR7 WEB-CLI · lb certificate
# Tab after the command
admin@TR7LBWAF01> lb certificate
add create-csr delete issue-internal
list renew-internal show update
 
admin@TR7LBWAF01> lb certificate list # list all of them
admin@TR7LBWAF01> lb certificate show <id> # show one
admin@TR7LBWAF01> lb certificate add type <type> name <name> …
admin@TR7LBWAF01> lb certificate create-csr name <name> cn <domain> …
admin@TR7LBWAF01> lb certificate issue-internal name <name> …
admin@TR7LBWAF01> lb certificate renew-internal certId <certificate>
admin@TR7LBWAF01> lb certificate update id <id> …
admin@TR7LBWAF01> lb certificate delete <id>
admin@TR7LBWAF01>  

In the add command the first field written is type

How the certificate will come is selected first; the name and the other fields are asked for after it.

Where the Certificate Comes From ​

CommandWhat it doesWhere the key is created
add type acmeShTakes it automatically from the ACME server and renews it before it expiresOn the device
add type manualSaves the certificate and key text at handOutside
add type pfxImports the certificate and the key in the PFX fileOutside
create-csrCreates a key and a certificate request (CSR) on the device; the request is signed by an external CA and it is completed by pasting the signed certificate into the record. The key does not leave the deviceOn the device
add type csrCreates a record of the same type by hand—
issue-internalCreates a leaf certificate from the internal intermediate CA with a certificate profile; a ledger row that carries on the automatic renewal is opened as wellOn the device
renew-internalRenews a certificate created internally right awayOn the device

add — The Required Fields ​

OrderFieldStatusValue
1typeRequiredacmeSh · manual · pfx · csr
2nameRequiredThe name of the record
3cert · keyConditionally requiredOnly in the manual type: the certificate and key text
3pfxFileConditionally requiredOnly in the pfx type: the PFX file

acmeSh — an automatic certificate with ACME ​

FieldWhat it doesWhat is written after it
--acmeShServerSelects the ACME server from which the certificate will be takenletsencrypt (default) · zerossl · sslcom · google
--acmeShEmailAddressGives the email address to be used in the ACME registrationAn email address
--acmeShChallengeTypeSelects how the ownership of the domain name will be provenhttp01 (default) · dns01
acmeShDnsProviderIdSelects the provider to be used in the DNS verificationThe lb acme-dns-provider record; when --acmeShChallengeType dns01 is written it becomes required and is written without a prefix right after it, even if there is a -- in the line
--acmeShDomains.N.domainWrites the domain name that the certificate will coverA domain name; each with its own index
--acmeShDomains.N.poolIdSelects over which vService the HTTP verification will be doneA vService record
--acmeShKeyLengthSelects the length of the key to be createdec-256 (default) · ec-384 · ec-521 · 2048 · 3072 · 4096
--acmeShRenewThresholdDetermines how many days before the expiry it will be renewed7 (default) · 14 · 30 · 45 · 90 · 180 days
--acmeShDeviceIdSelects on which cluster member the operation will be executedThe cluster id (default 1)
--acmeShZoneIdSelects from which virtual device the operation will be doneThe virtual device; the default is the device on which the command runs
--acmeShNamespaceSelects from which route table the operation will go outA route table (default 1)
--acmeShEabId · --acmeShEabHmacCarries the external account binding information that the server asks forThe id and the HMAC given by the provider; they open only while --acmeShServer is sslcom, google or zerossl

manual — uploading by hand ​

FieldStatusWhat it doesWhat is written after it
certRequiredSaves the server certificateThe PEM text; it is written inside double quotes
keyRequiredSaves the private key of the certificateThe PEM text
--passwordOptionalGives the password of the encrypted keyThe password of the key

pfx — importing from a PFX file ​

FieldStatusWhat it doesWhat is written after it
pfxFileRequiredTakes the file that contains the certificate and the keyThe PFX file on the device
--passwordOptionalGives the password of the PFX fileThe password of the file

The Chain Fields ​

These fields are common in the manual, pfx and csr types; they determine how the intermediate and root certificate will be completed.

FieldWhat it doesWhat is written after it
--intermediateCertProfileTakes the intermediate certificate from a ready CA profileA CA profile record
--extraIntermediateCertProfiles.NAdds additional intermediate certificates to the chainCA profile records; they open only when --intermediateCertProfile is given
--intermediateCertWrites the intermediate certificate directlyThe PEM text; it opens only when --intermediateCertProfile is left empty
--rootCertProfileTakes the root certificate from a ready CA profileA CA profile record
--extraRootCertProfiles.NAdds additional root certificates to the chainCA profile records; they open only when --rootCertProfile is given
--rootCertWrites the root certificate directlyThe PEM text; it opens only when --rootCertProfile is left empty
--allowDownloadTurns on the certificate being downloadable from the interfacetrue · false (default false)

The fields derived from the certificate are not written

The four fields below appear in the completion list but their values are filled in by the server while the certificate is being parsed; writing them by hand is not an expected use.

FieldWhat it doesWhat is written after it
--certContentHolds the content of the parsed certificateThe server fills it in; it is not written by hand
--certDnsNames.NHolds the DNS names that the certificate coversThe server fills it in; it is not written by hand
--infoArr.NHolds the additional key details parsed from the certificateThe server fills it in; it is not written by hand
--certEku.NHolds the extended key usage of the certificateThe server fills it in; it is not written by hand

create-csr — Creating a Certificate Request ​

It creates a private key on the device and a request to be sent to the CA. The key does not leave the device; the record is completed when the certificate signed by the external CA is pasted into the record.

OrderFieldStatusWhat it doesWhat is written after it
1nameRequiredGives a name to the recordThe name of the record
2cnRequiredDetermines the main name of the certificateThe Common Name, for example portal.kurum.com.tr
—--oOptionalWrites the name of the organizationThe Organization value
—--ouOptionalWrites the name of the unitThe Organizational Unit value
—--cOptionalWrites the country codeA two-letter country code, for example TR
—--sanOptionalWrites the additional names that the certificate will coverComma-separated names
—--keyAlgoOptionalSelects the key algorithmrsa2048 (default) · rsa3072 · rsa4096 · ecP256 · ecP384
—--allowDownloadOptionalTurns on the key being downloadable from the interfacetrue · false (default false)

issue-internal — Creating a Certificate with the Internal CA ​

It creates a leaf certificate from the internal intermediate CA according to a certificate profile. As a result an ordinary certificate record and a ledger row that carries on the automatic renewal are formed.

OrderFieldStatusWhat it doesWhat is written after it
1nameRequiredGives a name to the recordThe name of the record
2caIdRequiredSelects the CA that will sign the certificateAn intermediate CA created with lb ca
3profileIdRequiredSelects the profile that brings the settings such as the lifetime and the usageA Certificate Profiles record
4cnRequiredDetermines the main name of the certificateThe Common Name
—--sanOptionalWrites the additional names that the certificate will coverComma-separated names
—--allowDownloadOptionalTurns on the key being downloadable from the interfacetrue · false (default false)

renew-internal — Renewal ​

It renews a certificate created internally right away: a new key and a new serial number are created, the bound record is updated in place, and the service is reloaded with the new certificate.

OrderFieldStatusWhat it doesWhat is written after it
1certIdRequiredSelects the certificate to be renewedA certificate record created internally
TR7 WEB-CLI · the renewal confirmation screen
admin@TR7LBWAF01> lb certificate renew-internal certId <certificate>
⚠  The live certificate will be changed and the service will be reloaded. Shall it continue?
Type "yes" to confirm: yes
admin@TR7LBWAF01>  

Examples ​

TR7 WEB-CLI · A) An automatic certificate with Let's Encrypt (HTTP-01)
admin@TR7LBWAF01> lb certificate add type acmeSh name portal-cert \
--acmeShServer letsencrypt --acmeShEmailAddress pki@kurum.com.tr \
--acmeShChallengeType http01 --acmeShDomains.0.domain portal.kurum.com.tr \
--acmeShDomains.0.poolId <vService> --acmeShRenewThreshold 30
admin@TR7LBWAF01>  
TR7 WEB-CLI · B) A wildcard certificate with DNS-01
# when dns01 is selected, the DNS provider field opens
admin@TR7LBWAF01> lb certificate add type acmeSh name wildcard-cert \
--acmeShChallengeType dns01 acmeShDnsProviderId <provider> \
--acmeShDomains.0.domain "*.kurum.com.tr" --acmeShKeyLength ec-384
admin@TR7LBWAF01>  
TR7 WEB-CLI · C) Uploading by hand and importing a PFX
admin@TR7LBWAF01> lb certificate add type manual name elle-cert \
cert "<certificate-pem>" key "<key-pem>" --intermediateCertProfile <ca-profile>
 
admin@TR7LBWAF01> lb certificate add type pfx name pfx-cert pfxFile <file> --password <password>
admin@TR7LBWAF01>  
TR7 WEB-CLI · D) Creating a CSR and a certificate with the internal CA
# the request to be signed by an external CA
admin@TR7LBWAF01> lb certificate create-csr name externally-signed cn portal.kurum.com.tr \
--o "Kurum" --c TR --san "www.kurum.com.tr,api.kurum.com.tr" --keyAlgo rsa4096
 
# creation from the internal CA
admin@TR7LBWAF01> lb certificate issue-internal name internal-service caId <intermediate-ca> \
profileId <profile> cn servis.kurum.local --san "10.0.10.21"
admin@TR7LBWAF01>  

Binding to a vService ​

TR7 WEB-CLI · binding the certificate to a vService
# the certificate field is found only in the vServices of the HTTP and TCP types
admin@TR7LBWAF01> lb service update id <vService> --certificate.0 <certificate>
admin@TR7LBWAF01>  

Updating and Deleting ​

TR7 WEB-CLI · update and delete
admin@TR7LBWAF01> lb certificate update id <id> --acmeShRenewThreshold 45
admin@TR7LBWAF01> lb certificate update id <id> --allowDownload true
 
admin@TR7LBWAF01> lb certificate delete <id>
admin@TR7LBWAF01>  

Things to Know ​

  • It should be treated as if the type does not change later. With whichever type the record was created, its fields open accordingly; in order to get a certificate in another way, creating a new record is safer.
  • The renewal asks for confirmation. Before renew-internal runs, a confirmation screen saying that the live certificate will change and the service will be reloaded comes.
  • The CSR flow is two steps. create-csr creates only the key and the request; the record is not completed until the certificate signed by the external CA is pasted into the record. The key does not leave the device in this process.
  • The buypass server no longer issues certificates. The value stays in the list only so that the old records that point to that server can be edited; it should not be selected in new records.
  • The EAB information is not asked for on every server. --acmeShEabId and --acmeShEabHmac open only on the sslcom, google and zerossl servers.
  • The PEM texts require quotes. Since the certificate and key texts contain line breaks and spaces, they are written inside double quotes.