Skip to content

Commit e8fce6c

Browse files
committed
Added certificates and SBMJOB details
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
1 parent 54b40eb commit e8fce6c

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

src/content/docs/developing/debug/index.mdx

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,48 @@ If the Debug Service is not correctly configured, a warning sign will appear nex
139139
</Aside>
140140

141141
#### Generating certificates
142+
The Debug Service needs a certificate to be able to be started. This is required because the Debug Service is basically a web server exposing web services through HTTPS, and encrypting the traffic on HTTPS requires a certificate. Supported formats for the certificate are `PKCS12` and `JKS`. If Code for IBM i is used to generate the certificate, it will use the PKCS12 format.
142143

143-
By default, certificates are generated in `/QIBM/UserData/IBMiDebugService/certs` (which is the recommended location). If these certificates are deleted for some reason, they can be simply regenerated from the Manage view as described above. They are used only to encrypt the traffic between the clients and Debug Service.
144+
By default, certificates are generated in `/QIBM/UserData/IBMiDebugService/certs` (which is the recommended location). The path to the Debug Service certificate is set in `/QIBM/ProdData/IBMiDebugService/bin/DebugService.env` with `DEBUG_SERVICE_KEYSTORE_FILE`.
144145

146+
The Debug Service certificate can only be generated if it's missing. In this case, the IBM i Debugger view will show this error:
147+
148+
![](./debug10.png)
149+
150+
Clicking on the Setup Service Certificate button will start a process that offers to either generate a certificate or import an existing one (`PKCS12` format only). Once the certificate is successfully generated or imported, two files will be found under `/QIBM/UserData/IBMiDebugService/certs`:
151+
* `debug_service.pfx`
152+
* the Debug Service certificate, used by the service to encrypt the communication.
153+
* `debug_service.crt`
154+
* the client certificate that clients must download if the `Secure Debug` option is turned on in Code for IBM i.
155+
156+
If these certificates are deleted for some reason, they can be simply regenerated from the IBM i Debugger view as described above. They are used only to encrypt the traffic between the clients and Debug Service.
157+
158+
If `Secure Debug` is on and the client certificate cannot be found locally or does not match the remote certificate, Code for IBM i will show a warning in the IBM i Debugger view and offer an action to import the client certificate.
159+
160+
![](./debug11.png)
161+
162+
163+
#### Starting the Debug Service from Code for IBM i
164+
Starting the Debug Service can be done from the IBM i Debugger view and requires `*ALLOBJ` special authority.
165+
166+
![](./debug12.png)
167+
168+
Clicking on the action to start the Service will first show a prompt showing `SBMJOB` parameters. Since the shell script that starts the service will be submitted, this lets you modify the submission parameters if needed. Only the `CMD` and `JOB` parameters are imposed.
169+
170+
![](./debug13.png)
171+
172+
Once the prompt is validated, the SBMJOB command will be executed and Code for IBM i will monitor its execution until the Debug Service is actually started (or fails to start).
173+
174+
#### Starting the Debug Service outside of Code for IBM i
175+
If the Debug Service was configured from Code for IBM i (i.e the certificate was generated from Code for IBM i), then it is possible to start the Debug Service by running the same `SBMJOB` command that Code for IBM i uses:
176+
177+
```
178+
SBMJOB CMD(STRQSH CMD('/QOpenSys/pkgs/bin/bash -c /QIBM/ProdData/IBMiDebugService/bin/startDebugService.sh')) JOB(DBGSVCE) JOBQ(QSYS/QUSRNOMAX) JOBD(QSYS/QSYSJOBD) USER(*CURRENT)
179+
```
180+
181+
<Aside type="tip">
182+
This will only work if Code for IBM i was used to configure the Service and generate its certificate.
183+
</Aside>
145184
---
146185

147186
## Debug Service ports

0 commit comments

Comments
 (0)