Skip to content

dcmassign - not working  #49

@richardm90

Description

@richardm90

I've tried using the dcmassign command to assign my certificate to a HTTP server instance.

It didn't work!

The first problem I hit was when trying to pass the Application Id on the command line like this.

dcmassign -v --cert="CN=rmwebsrv.rmsoftwareservices.co.uk" QIBM_HTTP_SERVER_RMWEBSRV

This returned the message ERROR: Application ID is required. I've worked out why this occurs and I'll submit a PR to correct it but I need a hand with the next part. I'm not a Java developer nor very familiar with the JTOpen/JT400 classes!

When I ran the command again I got the message The parameter [1]: Parameter value is not valid.. After reviewing the parameters, which all looked OK, I decided to turn trace on and this showed me the problem.

Thread[main,5,main]  Tue Oct 31 11:40:51:019 GMT 2023  Parameter list length is larger than 7 parameters, all parameters must be passed as pointers. The parameter   1
ava.lang.Throwable
	at com.ibm.as400.access.Trace.logData(Trace.java:776)
	at com.ibm.as400.access.Trace.log(Trace.java:836)
	at com.ibm.as400.access.Trace.log(Trace.java:960)
	at com.ibm.as400.access.ServiceProgramCall.run(ServiceProgramCall.java:320)
	at com.github.ibmioss.dcmtools.utils.DcmApiCaller.runServiceProgram(DcmApiCaller.java:308)
	at com.github.ibmioss.dcmtools.utils.DcmApiCaller.callQycdUpdateCertUsage(DcmApiCaller.java:197)
	at com.github.ibmioss.dcmtools.DcmAssignCmd.main(DcmAssignCmd.java:158)

There appears to be some restriction when the number of parameters if greater than 7. The QycdUpdateCertUsage API has 8 parameters. I then decided to review the ServiceProgramCall docs.

This was interesting as it pointed out a couple of possibilities regarding parameters, notably it mentions the following.

  • Up to seven parameters can be passed to the service program.
  • When pass by reference, the data is copied from Java storage to system storage, then a pointer to the system storage is passed to the service program.
  • Up to four bytes can be passed by value. Parameters longer than four bytes must be passed by reference which may require a change to the service program.

If I change all of the parameters to be passed by reference it works but before I submit a PR I'd like to understand the impact of this change. Maybe service program call parameters should always be passed by reference? Can anyone help? I guess the real question is how do I decide whether the parameter should be passed by reference or value?

Changing the parameter types for the renew command should also help with issue #43 and PR #48.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions