How To- Reset domain Tls Certificate using PowerShell API

How To- Reset domain Tls Certificate using PowerShell API


How To: Reset Domain TLS Certificate using PowerShell API


Question
How do I reset the TLS certificate for a domain using the PowerShell API?


Answer
You can reset the domain TLS certificate via the PowerShell API by executing the appropriate command that targets the domain object and triggers a certificate renewal or reissue.


Pre-requisites

Titan Api Enabled - How To: Use Titan API


Steps

  1. Login to Titan Api

$loginResponse = Invoke-Login -username admin -password mypass -AdminUrl localhost:31443

$loginResponse.Result | Format-List


  1. Get domain list

$dom = Get-DomList -AdminUrl localhost:31443

$dom.Response.DomainList 


  1. Get the DomainGuid and use to list down the domainparam

$domparam = Get-DomParam -AdminUrl localhost:31443 -DomainGuid 4fe58d04-8c68-4b57-a3b4-8953fb2dd147

$domparam.Response | Format-List 


  1. Get the TlsLasCertGuid and use it to remove Certificate

$adminUrl = "localhost:31443"

$domainGuid = "4fe58d04-8c68-4b57-a3b4-8953fb2dd147"

$certGuidToRemove = "db2112ad-0000-0000-0000-100000000001"


# Check current assignments

$domain = Get-DomParam -AdminUrl $adminUrl -DomainGuid $domainGuid


# Remove assignment if it's currently used

if ($domain.Response.TlsLasCertGuid -eq $certGuidToRemove) {

   $if1 = Set-DomParam -AdminUrl $adminUrl `

                -InputObject ([Titan.API.Models.TitanApiIdentity]@{DomainGuid=$domainGuid}) `

                -TlsLasCertGuid $null `

                -Confirm:$false

   $if1.Response.tls

}


if ($domain.Response.TlsRasCertGuid -eq $certGuidToRemove) {

   $if2 = Set-DomParam -AdminUrl $adminUrl `

                -InputObject ([Titan.API.Models.TitanApiIdentity]@{DomainGuid=$domainGuid}) `

                -TlsRasCertGuid $null `

                -Confirm:$false

   $if2.Response

}



  1. Check again the selected TlslasCertGuid to see if the process is successful

$domparam = Get-DomParam -AdminUrl localhost:31443 -DomainGuid 4fe58d04-8c68-4b57-a3b4-8953fb2dd147

$domparam.Response.TlsLasCertGuid



  1. After confirming TlsLasCertGuid has been reset. Restart the service in Windows Services.
  2. Once the service is restarted, access the Titan default local URL:

https://localhost:31443

  1. Confirm in Titan Admin Web UI the changes.



    • Related Articles

    • How To - Create New Tls Certificate for FTP FTPS

      How To: Create New TLS Certificate for FTP/FTPS Question How do I create a new TLS certificate for securing FTP/FTPS connections? Reasoning Creating a new TLS certificate ensures encrypted and secure connections for FTP/FTPS servers, protecting data ...
    • Howto - Generate and Install Web TLS Certificate in TitanSFTP

      How To: Generate and Install Web TLS Certificate in Titan SFTP Question How To: Generate and Install TLS Certificate in Titan SFTP Reasoning Why do we need to install TLS Certificate on our HTTPS Website Answer Installing TLS and using HTTPS is ...
    • How To: Use Titan API

      How To: Use the Titan API Question Does Titan provide an API? Reasoning I am interested in working with Titan Server programmatically. Answer Titan provides an OpenAPI 3.0.x specification for its REST API, available at ...
    • How To - Reset Admin Account using sqllitestudiocli

      How To: Reset Admin Account using SQLliteStudio CLI Question How can you reset the admin account? Reasoning When an admin user can't log in and support ticket submission isn't possible, one way to regain access is by directly modifying or clearing ...
    • Custom Branding using PowerShell Script

      Titan Server: Custom Branding and Logo using PowerShell Question How do I custom brand the interface for Titan Server using a PowerShell script? Reasoning I want the interface to match my organization’s look and feel. Answer Yes, the server interface ...