Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move certificate related settings out of DebugService.env #2416

Closed
mkwan01 opened this issue Dec 13, 2024 · 2 comments · Fixed by #2417
Closed

Move certificate related settings out of DebugService.env #2416

mkwan01 opened this issue Dec 13, 2024 · 2 comments · Fixed by #2417
Labels
idea Feature suggestion

Comments

@mkwan01
Copy link

mkwan01 commented Dec 13, 2024

Code for IBM i currently saves the following certificate related settings to /QIBM/ProdData/IBMiDebugService/bin/DebugService.env:

JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk11/64bit
DEBUG_SERVICE_KEYSTORE_FILE=/QIBM/UserData/IBMiDebugService/certs/debug_service.pfx
DEBUG_SERVICE_KEYSTORE_PASSWORD=xxxxxxxxx
CODE4IDEBUG=$([ -f $DBGSRV_WRK_DIR/.code4i.debug ] && cp $DBGSRV_WRK_DIR/.code4i.debug $DBGSRV_WRK_DIR/key.properties)

This solution has two problems:

  1. The settings will be removed if we update the debug service PTF.
  2. It may create a conflict with other debug setup scenarios which do not use vscode.

Starting from debug service version 2.0.1, the startDebugService.sh script checks for a new environment variable DEBUG_SERVICE_EXTERNAL_CONFIG_FILE. If this environment variable is set, the script will load the settings specified in the external file.

Here is the proposed solution to move the certificate settings:

  1. Store the certificate settings in a file under /QIBM/UserData/IBMiDebugService. The files under the UserData folder will not be overwritten by a debug service PTF install.
  2. Set the environment variable DEBUG_SERVICE_EXTERNAL_CONFIG_FILE to the fully qualified path of the new setting file under UserData, before running the startDebugService.sh script.

Of course, you need to check for the debug service version. You can only use the new solution if debug service is at version 2.0.1+. Please note that JAVA_HOME is no longer required in 2.0.1+. It will be defaulted to /QOpenSys/QIBM/ProdData/JavaVM/jdk11/64bit if JAVA_HOME is not set.

@worksofliam @sebjulliand

@mkwan01 mkwan01 added the idea Feature suggestion label Dec 13, 2024
@heymchri
Copy link

👍

@sebjulliand
Copy link
Collaborator

Thank you for all the details @mkwan01 ! I opened PR #2417 to take advantage of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Feature suggestion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants