Jump to content
  • BW6.X - BWCE - Security - How to expose an API or a Service in HTTPS in BusinessWorks and BusinessWorks Container Edition


    This article goal is to explain how to set-up an HTTPS configuration with one way SSL when BusinessWorks is acting as a server exposing a REST API or a SOAP Service.

    Overall architecture

    The following diagram is showing the server and client components and their relative keystore and truststore files with their contents.

    1*4YJmxkB4qQWsphu6vjRLaQ.png

    Pre-requisites

    To set-up a server HTTPS configuration with one way SSL you need the following elements:

    . A private key stored in a Keystore file

    . The Keystore file password

    . The private key alias

    . The private key password

    Example of a Keystore file containing a private key seen in the Key Explorer tool :

    1*G6-iXqd4d8eMdEvdEYfP4w.png

    On the screen shot above you can see the private key alias that is ‘myservice’.

    The private key includes the related public keys.

    1*2bW53xwtOZIF0j37NdVqKQ.png

    Set-up of the BusinessWorks configuration

    Assuming that the configuration to expose the REST API or the Service in plain HTTP is already set-up the following actions need to be completed to change the configuration to HTTPS:

    #1 in the HTTP Connector resource check the Confidentiality option

    1*kc_YRFMn5mJcAUL2cpqung.png

    #2 Click on the button to select or create an SSL Server Configuration

    1*VxKtKUlGn3M6_Bva9Web7g.png

    #3 Click on Create shared resource (or select an existing resource)

    1*utKgbMd4HRPrRrfqaMbyIg.png

    #4 Enter a name for the new SSL Server resource and click Finish (if creating a new resource)

    If you create a new resource you can select to use the suggested name or enter a new one.

    1*jKNKArZlJhqQJSaykoP6Sg.png

    #5 In the SSL Server Resource click the button to select or create an Identity Store Provider

    1*QUH6i6rqGEYfi16SP5VZ6w.png

    #6 Click on Create Shared Resource (or select an existing resource)

    1*5uWO2BEoOmT3IQlKaNHRHA.png

    If you create a new resource you can select to use the suggested name or enter a new one.

    #7 Configure the Key Store provider

    Select the Provider (SUN is the default value when nothing is selected), enter the path to the KeyStore and the KeyStore password (these values should be managed using properties). You may also need to adjust the Keystore type.

    Note that by default BusinessWorks is trying to refresh KeyStore files every hour, this allows a KeyStore to be updated without downtime (which is useful to manage Certificates expiry).

    1*QO5g9dLUSnr307-GEk1t3A.png

    # 8 Complete the configuration of the SSL Server resource

    Enter the Key Alias name and Key password (these values should be managed using properties). Leave the ‘Enable Mutual Authentication’ option unselected.

    1*3HwlsXWKAEndsxnrEOxecQ.png

    Note : depending on the security requirements you have to manage you may need to adjust the values of some of the parameters present in the ‘Advanced SSL Server Configuration’ section.

    #9 Save your project and check the configuration

    The HTTP connector resource should look like this:

    1*G5i8cOkEPb3fGMu_eatsyA.png

    The SSL Server resource Configuration should look like this:

    1*XE3UAw6CeQ9YNh7lGHxQqA.png

    The KeyStore provider resource configuration should look like this:

    1*064y-eiF3_F6Kr_DuyX4lA.png

    Access to the REST API or Service from a BusinessWorks client application

    To access from BusinessWorks a REST API or a Service exposed over HTTPS you need to use an HTTP Client Shared Resource configured to use the Public Certificates corresponding to the server private key.

    This is explained in this article : https://community.tibco.com/articles/tibco-activematrix-businessworks/bw6x-bwce-security-how-to-configure-an-http-client-connection-to-access-a-rest-api-or-web-services-exposed-over-https-in-businessworks-6x-and-businessworks-container-edition-r3387/

    Useful information

    To write this article I used a set of sample Keystore files available at the following URL (download the x.509-sample-keys-and-certificates.zip file):
    https://www.swview.org/blog/sample-x509-certificate-collection-publicprivate-keys-java

    Article explaining how to debug SSL / TLS configuration in BusinessWorks :
    https://community.tibco.com/articles/tibco-activematrix-businessworks/bw6x-bwce-how-to-debug-ssltls-connections-in-businessworks-and-businessworks-container-edition-r3392/

    Additional elements

    You can refer to the attached project sample.

    ExposeHTTPSOnewaySSLDemo.zip


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...