In order to update the k2 application certificate you need to do the following steps on the IIS and the k2 application, this is one way of updating the certificate as I'm sure there's others. In this approach you will be able to access both the old url "localhost" and the new one.
Prerequisite:
SSL Certificate for your new DomainURL, and its added to the K2 server certificates.
Login in into the K2 server as administrator or as the setup account.
-
Configuring the IIS:
Step 1: Open the IIS by typing IIS on the Windows search.
Step 2: Expand the Sites to reach to the K2 website and select it, On the Right on the Actions section click on the Bindings.. under the Edit Site section then Click on Add.. under the Site Bindings page.
Step 3: On the Add Site Binding page select the type as https then type the Host name "the new DomainURL" and select the right certificate under the SSL Certificate once all done click on OK.
-
Configuring the K2 Application:
Step 4: Go to Management > Authentication > Claims > Realms, Select on one of the URl to showcase their Audiences then click on New
Step 5: Type your Domain name into the New Audiences Section like shown above.
Step 6: Rebate step 4 and 5 for of each column, /ViewFlow/ , /Runtime/ and /Designer/.
To validate try to access the new DomainURL.
note: make sure you can ping the new DomainURL within the same K2 server if it's not resolving make sure you have added the record to the hosts file.