codefori/vscode-ibmi

OpenSSL "Wrong version number" error

Opened this issue · 8 comments

I have tried to use the debugger for the first time (since working out a domain issue previously).

Certificates generated and downloaded OK and was able to start Debug Server and Debug Service. However, on trying to set a Service Entry Point for the first time, I received the error:

EQAVS1007E on port 8005 could not be connected.
Message received: write EPROTO 8870656:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:....\third_party\boringssl\src\ssl\tls_record.cc:231:

No SEP was set according to the interface.

I have no idea what this error means.

No-one has any idea on this? I've found two classes of error around the 'net that have similar symptoms - one says I'm using the wrong OpenSSL, but there is an issue on this project that says this is directly addressed now, and one says I'm using HTTPS when HTTP is required, which surely cannot be the case given the generation of certificates required to get this far.

I have recreated the error with the Debug in Batch option as well, so it is not specific to the type of debug.

Well I have "progress" on this issue. What may not be clear from my copy-pasted error is that first line...

EQAVS1007E on port 8005 could not be connected.

Note the two spaces after the error code. Despite the highly generic message, this clued me in to maybe it didn't know who to talk to at all.

I had previously seen the launch.json file - it jumped into my editor at some point, and I had not closed it as I wanted to figure out what purpose it serves. I noticed in each block it has an empty host: "" definition. Curious, I filled in the one for Service Entry Points and tried connecting again. A new error!

"Self signed certificate". Well yes, because it was generated for me! OK, so more searching...

I next found issue #2190 which mentioned installing a CA-issued cert. I have one of those. We use it successfully for Apache instances and even some bash services.

I followed the import process detailed in that issue and now I get yet another error.

self signed certificate in certificate chain

No, I disagree. The certificate is issued by our company and our Windows computers trust the issuer. I proved this is the case both for my computer by issuing a curl to the server in question, and for that server by issuing a curl from it to another server with a certificate by the same issuer. Does VSCode have its own list of trust anchors??

Next I followed another tip in the aforementioned issue - using a browser to inspect the certificate returned on port 8005. I had used this approach with the original, self-generated certificate and was indeed able to view it. Now with my CA-issue certificate installed (I am led to believe), the server response on port 8005 - either from a browser or from a curl - is "empty response" (close_notify). So I cannot even validate which certificate is being offered up.

I don't know if I should have edited the host entry in launch.json as this file is not even mentioned in the limited documentation. That documentation just gives very rudimentary steps and assumes it all just works. It clearly doesn't.

This project is a great enabler... or it would be if it would just be documented fully. A lot of the time I don't know if my problem is with Code for i, or VSCode, or Windows, or the server. I have little chance of figuring this out easily because there is so little information to go on other than issues from other poor souls who trip over the seemingly endless land mines like I do.

Also... this issue was opened over a month ago and has not received any more attention than being labelled a debug issue.

@zkarj735 sorry about that. The biggest problem with the debugger is that it is not maintained by anyone who works on Code for IBM i. So when issues arise, there is not much the maintainers can do.

I've passed this issue to someone on the debug team at IBM. Hopefully they can help.

This project is a great enabler... or it would be if it would just be documented fully. A lot of the time I don't know if my problem is with Code for i, or VSCode, or Windows, or the server. I have little chance of figuring this out easily because there is so little information to go on other than issues from other poor souls who trip over the seemingly endless land mines like I do.

Also... this issue was opened over a month ago and has not received any more attention than being labelled a debug issue.

Wow, slow down with the cheap shots here pal. All of this is provided to you by the OSS community and volunteer maintainers, and sometimes, life gets busy! You're more than welcome to take on your personal free time to improve the documentation and help other people struggling with the extension 😊

The debug client extension and debug service is provided and maintained by IBM, as closed source projects. We're dealing with the cards we were given and it's a little bit of a struggle, as you figured out.

I'm sorry if you feel that way, but here's my viewpoint.

Code for i is not just an OSS project that I might stumble on - it is actively touted to the IBM i community through multiple channels, including directly from IBM. This is a community used to the level of documentation IBM provides for the OS on this amazing platform.

Here's my problem... I would certainly consider improving the documentation (and I have already done so once before in a very minor way) but I am not trying to figure out some subtlety of a problem here... I literally have to guess at what all the pieces are. Which is why I asked the question. I asked in the hope that people who already understand a lot more of how it works than I do might at least offer some suggestions to work with. Even if that was just "sorry, the debugger isn't happy and we don't know why".

In my missive above, I asked about the launch.json file. It is clearly a significant part of the configuration yet is, as far as I could find, not mentioned at all in the Code for i documentation. Furthermore, my question about it elicited no further information on my guessed approach to it.

We all know that documentation comes last. Heck, I used to be "that guy". Until I realised that documentation is as important as the code. This is why my team has a knowledgebase that has, last time I counted, well over 600 detailed articles on any tools and processes we have created as well as many that came before our time that we have figured out. We're sysadmins, not programmers, but we do use code (RPG, CL, SQL) to help automate stuff.

I understand the debugger is closed source and the Code for i maintainers are in the dark on its secrets, but this is not the first time I've had to guess at how Code for i works because the documentation is still very much in a "happy path" stage. If it explained all the pieces and where and why they are used, I might have a fighting chance at figuring out the issues on my own - and updating the documentation where there are gaps.

@zkarj735 Obviously you're very passionate about this project, and I am grateful for that. But, open-source is like a birthday present. You can use it and enjoy it, or you can get rid of it and never used it again. It's your to do as you wish.

There are 4 core maintainers of the project and Code for IBM i, and subsequent extensions, are not our full time jobs. IBM do commit my time to working on it, which is great, but it's not 100% of my time, and priorities are spread out to make sure things get fixed and improved across the board. None of the maintainers are paid (other than me, by my employer) to work on Code for IBM i. They do it when they are able to, because they want to.

For the record, I fully agree that our documentation could do with more enhancements. But, in this project, documentation is just like code; we have to prioritize and find the time to work on it. I can guarantee that documentation is updated as we work on new features, but perhaps it doesn't go in depth enough.

It seems like the project is not up to your standards, which does make me sad, and we don't expect you to use it. You are free to not use it as much as you are free to use it. Of course, the maintainers want to help solve issues as fast as we can. For the sake of this issue, specific to the debugger, there wasn't much we can do. It was tagged debug so someone from IBM could take a look at it (which they didn't, I am looking into this).

I can appreciate that you have told us what needs to be improved, and this is something I will hold onto as I work through my priorities for the projects. With that said, you are also welcome to contribute more. Sometimes, I find that the time spent replying to issues could be time spent contributing to docs or code to solve the issue.

I hope we can work on improving based on your suggestions, and better yet, having more documentation contributions from you so we can make improvements for all our users.


I thought it might be worth me explaining some specific parts.

I asked in the hope that people who already understand a lot more of how it works than I do might at least offer some suggestions to work with.

I am trying to get someone from IBM to look at this.

In my missive above, I asked about the launch.json file. It is clearly a significant part of the configuration yet is, as far as I could find, not mentioned at all in the Code for i documentation.

That is because Code for IBM i does not do anything with the launch.json file, so therefore we don't document anything. It is used by the debugger and not anything involved with us. It is documented in the VS Code docs, though.

@zkarj735 We recommend the users to use the integrated debug actions in Code for IBM i to start a debug session. Please follow the steps below:

  1. Create an object filter in the Object Browser view
  2. Expand the filter to show the program you want to debug
  3. Right click on the target program and select Start Debugging > Debug as Batch
    image

@zkarj735 If you use the launch template in launch.json, please add the following parameters into the launch entry and try again:

        "secure": true,
        "ignoreCertificateErrors": true,