Skip to content

Conversation

anpanigr
Copy link
Member

@anpanigr anpanigr commented Mar 25, 2021

Here is the usecase description

Create a MII domain with an attached persistent volume.
Configure custom identity and custom trust on server template
Enable SSL on server template with port 8002 (default 7002 does not work)
Put the IdentityKeyStore.jks and TrustKeyStore.jks on /shared directory
after administration server pod is started so that it can be accessible
from all managed server pods
Once all servers are started get the JNDI initial context using cluster
service URL with t3s protocol.
Repeat the same after scaling the cluster

Note - Added a new SslUtils class to deal with SSL related tasks

Jenkin Result
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/4413/
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/4419/

@anpanigr anpanigr changed the title Add Integratio tests with Custom SSL IdentityStore/TrustSore Add Integration tests with Custom SSL IdentityStore/TrustSore Mar 25, 2021
@anpanigr anpanigr requested review from marinakog and sankarpn March 25, 2021 14:34
@@ -0,0 +1,21 @@
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new file, remove 2020

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

public class SslTestClient {
private String url;

public SslTestClient(String[] args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we call it ssl client? there the ssl invoke happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It takes t3s URL to get initial context.

adminServerPodName, domainNamespace);
checkPodReadyAndServiceExists(adminServerPodName, domainUid, domainNamespace);
// Generate JKS Keystore using openssl before
// managed server services and pods are ready
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is JKS Keystore required before the managed server service and pods are ready? How do you control the keystore is copied before the managed server service and pods are ready?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copy the file immediately after the admin pod is ready and before managed server is being started. That is why insert the copy command between admin server service check and managed server service check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there will be possible race condition. If the keystore is required before the managed server is started, then you can start the admin server first, then copy the files and start the managed servers. CheckPodReady() method only checks the status of the pod and does not control when to start the pod.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After admin server is started it takes few seconds to create the table/JKS files before introspector picks the managed server which takes a minutes to start the server. I also checks if the JMS Server MBean are in proper managed server before proceeding tests. If I see the failure in nightly I have to create a dummy WebLogic Pod to create the table before the domain starts.

-storepass changeit -noprompt

#keytool -list -v -keystore TrustKeyStore.jks -storepass changeit
#keytool -list -v -keystore IdentityKeyStore.jks -storepass changeit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented out lines

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,51 @@
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove 2020

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


public SslTestClient(String[] args)
{
url = args[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reformat this line

Copy link
Member Author

@anpanigr anpanigr Mar 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done
url = args[0];

url = args[0];
try {
Context ctx = getInitialContext();
System.out.println("Got the Initial JNDI Context ["+ctx+"]");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space around "+"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

System.out.println("Got the Initial JNDI Context ["+ctx+"]");
String cfName="weblogic.jms.ConnectionFactory";
ConnectionFactory qcf=(ConnectionFactory)ctx.lookup(cfName);
System.out.println("Looked up default JMS connection factory ["+qcf+"]");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space around "+"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

ConnectionFactory qcf=(ConnectionFactory)ctx.lookup(cfName);
System.out.println("Looked up default JMS connection factory ["+qcf+"]");
} catch ( Exception ex ) {
System.out.println("Got Unknown Exception ["+ ex + "]");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space around "+"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@rjeberhard rjeberhard merged commit b1dee39 into develop Mar 26, 2021
@rjeberhard rjeberhard deleted the custom-ssl branch January 31, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants