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

Problems using TLSsocketz #40

Open
LGeyer opened this issue Dec 7, 2023 · 11 comments
Open

Problems using TLSsocketz #40

LGeyer opened this issue Dec 7, 2023 · 11 comments

Comments

@LGeyer
Copy link

LGeyer commented Dec 7, 2023

I created an application on XP which is then tested (and running) on W7, W10 and W11. It sends and reads mails using pop3 and smtp. Now I wanted to convert to vbAsyncSocket to be able to use SSL and TLS1.2. However I found some differences:

  • the events datarrival and sendprogress are not available
  • the error events uses different parameters
    What can I do?

If necessary I can send you the sources of my classes. (comments are some times in german)

@wqweto
Copy link
Owner

wqweto commented Dec 8, 2023

Do you currently use Winsock conrol to send/read mails using pop3 and smtp?

There is a ctxWinsock replacement control under Contrib directory of the repo which has the same properties, methods and events you are looking for:

Event Connect()
Event CloseEvent()
Event ConnectionRequest(ByVal requestID As Long)
Event DataArrival(ByVal bytesTotal As Long)
Event SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long)
Event SendComplete()
Event Error(ByVal Number As Long, Description As String, ByVal Scode As UcsErrorConstants, Source As String, HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)

Using an ActiveX control for networking operations is highly not recommended so best would be to migrate everything (eventually) to cTlsSocket class.

@LGeyer
Copy link
Author

LGeyer commented Dec 8, 2023

No, I don't use Winsock, I use CSocketMaster V1.5, created by Emiliano Scavuzzo. It's description: Winsock api implementation class.
So I have to rewrite the methods and event interface?

@wqweto
Copy link
Owner

wqweto commented Dec 8, 2023

So I have to rewrite the methods and event interface?

Another option is to implement a CSocketMaster replacement class which uses cTlsSocket class internally the way ctxWinsock is implemented so that you don't have to rewrite your client code but just plug in the replacement class instead.

You don't have to implement all methods/properties of CSocketMaster but just the ones you use in your client code.

p.s. Btw, cTlsSocket supports both TLS and non-encrypted traffic so it's easier to migrate projects to TLS from current non-encrypted situation using it.

@wqweto
Copy link
Owner

wqweto commented Dec 11, 2023

Btw, I can only find V1.3 of CSocketMaster here.

Will try make a replacement class based on this version soon. The properties/methods look very much like Winsock control ones.

@wqweto
Copy link
Owner

wqweto commented Dec 12, 2023

There is a new cTlsRemaster.cls addition just landed to contrib directory which is a CSocketMaster replacement class which keeps the signature of properties, methods and events the same as original.

Should be able to use it as a drop-in replacement in your sources, just add cTlsRemaster.cls, cTlsSocket.cls, cAsyncSocket.cls and mdTlsNative.bas source files to your project.

If you need this compiled in a binary let me know and I'll make a separate Ax-DLL project the way other binaries get compiled as Assets under the repository's releases section.

@LGeyer
Copy link
Author

LGeyer commented Dec 26, 2023

Sorry for the long delay...
You can load version 1.5 of CSocketMaster from https://telmarkt.de/dload/CSocketMaster15.cls

@LGeyer
Copy link
Author

LGeyer commented Dec 26, 2023

Using an ActiveX control for networking operations is highly not recommended so best would be to migrate everything (eventually) to cTlsSocket class.

Why not recommended?

@wqweto
Copy link
Owner

wqweto commented Dec 27, 2023

Why not recommended?

Because GUI has nothing to do with networking per se. Using invisible controls on forms is a late century "invention" which was amusing and cool when VBX components first appeared.

Nowadays you don't want to use a form to host a control for your networking protocol needs. You just use a regular class (or a module) to encapsulate functionality.

@LGeyer
Copy link
Author

LGeyer commented Jan 3, 2024

I assume cTlsSocket can be used to convert from FTP to SFTP too?
I just got a message from our service provider that they will switch to SFTP on August, 31st.

@wqweto
Copy link
Owner

wqweto commented Jan 3, 2024

I assume cTlsSocket can be used to convert from FTP to SFTP too?

No. SFTP has nothing to do with FTP protocol. It's an SSH based sub-protocol.

It is FTPS to FTP the way HTTPS is to HTTP i.e. the same protocol w/ TLS transport security.

@LGeyer
Copy link
Author

LGeyer commented Jan 3, 2024

Unfortunately I am not very familiary with network protocols. What do I have to do to convert from FTP to Secure FTP?
Where is FTPS used?

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

No branches or pull requests

2 participants