{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
4

Dynamic SSLInfo for TargetEndpoint using variable reference  

  • Export to PDF
arghya das created · Apr 05, 2016 at 09:05 PM · 2.4k Views · edited · Apr 05, 2016 at 10:31 PM

Apigee Edge API Management platform introduced a feature in the last cloud release 160120, whereby you could have variable references for keystore, keyalias etc. Please use this feature if you want to have these names dynamically set. The documentation is available here:

Here's an example. You can create a target endpoint definition like this:

<?xml version="1.0" encoding="UTF-8"?>
<HTTPTargetConnection>
   <URL>https://api.mytarget.com</URL>
   <SSLInfo>
      <Enabled>{myvars.ssl.enabled}</Enabled>
      <ClientAuthEnabled>{myvars.ssl.client.auth.enabled}</ClientAuthEnabled>
      <KeyStore>{myvars.ssl.keystore}</KeyStore>
      <KeyAlias>{myvars.ssl.keyAlias}</KeyAlias>
      <TrustStore>{myvars.ssl.trustStore}</TrustStore>
   </SSLInfo>
</HTTPTargetConnection>

Now you can have these variables defined in an assignMessage policy like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="SetSSLInfoVariables">
    <DisplayName>SetSSLInfoVariables</DisplayName>
    <Properties/>
    <AssignVariable>
        <Name>myvars.ssl.enabled</Name>
        <Value>true</Value>
    </AssignVariable>
    <AssignVariable>
        <Name>myvars.ssl.client.auth.enabled</Name>
        <Value>true</Value>
    </AssignVariable>
    <AssignVariable>
        <Name>myvars.ssl.keystore</Name>
        <Value>freetrial</Value>
    </AssignVariable>
    <AssignVariable>
        <Name>myvars.ssl.keyAlias</Name>
        <Value>freetrial</Value>
    </AssignVariable>
    <AssignVariable>
        <Name>myvars.ssl.trustStore</Name>
        <Value>freetrial</Value>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

How does this help ?

Imagine a scenario, where you are connecting to a backend endpoint over ssl and depending on whether you are connecting to the test or prod environment of that server you need to use appropriate keystore and truststores. With this feature it becomes really simple to do that, without having to change your proxy implementation all the time. Based on the request, have your API proxy evaluate which environment the API call needs to go to, then execute the appropriate Assign Message policy that sets the correct keystore and truststore values. The environment name is populated in the flow variable "environment.name".

I am also attaching the sample bundles that can help you explore this feature.

apigee-ssl: the proxy bundle that actually uses the dynamic keystore references apigee-ssl.zip

apigee-target: proxy bundle that acts as a mock backend which works over ssl apigee-target.zip

You can deploy these two bundles to your apigee orgs and try it for your self. It uses the default freetrial keystore that comes out of the box with your Edge org on the cloud. Here's a screenshot from trace showing how these variables get set and the call to the target is made:

dynamickeystorereference.png (147.4 kB)
apigee-ssl.zip (2.6 kB)
apigee-target.zip (2.6 kB)
thub.nodes.view.add-new-comment
ssl2-way ssldynamic target endpointsslinfokeystores
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Article

Contributors

avatar image avatar image

Follow this article

31 People are following this .

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Navigation

Dynamic SSLInfo for TargetEndpoint using variable reference

Related Articles

Uploading multiple certs to a truststore as a single file now supported

How to enable SSL on Apigee Edge?

SSL ciphers supported

How to create a Private Key and generate a CSR?

Unable to connect to Edge-ui after upgrade to 4.17.01 when using SSL.

Adding multiple certificate chains to a trust store

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges