0

Can anyone point me to a detailed implementation of the SSL_write API. Are there any alternatives to using the SSL_write or SSL_read API.

A broader overview: I am trying to instrument the SSL_write/SSL_read function with a SSL client. That is every time there is a SSL_read/SSL_write call from any application, it will end up using my custom SSL client.

Problem I am facing: If I simply add a ssl client code to an instrumented SSL_write function how do I send or recieve data. I cannot use the SSL_write API as that would create a recursive call to the SSL client code.

Choi
  • 151
  • 1
  • 2
  • 13
  • The "problem I'm facing" part is trivially solved by loading the library that exposes SSL_write dynamically and getting the function address through the relevant API (we are talking about dlopen/dlsym on POSIX). – Matteo Italia Jan 18 '16 at 23:45
  • 1
    Lookup *symbol interposition* for the solution to your problem. – fuz Jan 18 '16 at 23:47
  • 1
    `int (*SSL_write_orig)(SSL *ssl, const void *buf, int num) = dlsym(RTLD_NEXT, "SSL_write");`. See also: http://stackoverflow.com/questions/34840510/how-to-replace-pthread-create-during-linkage – Ctx Jan 18 '16 at 23:59

0 Answers0