Please excuse me sending the previous message twice to this list.
This was due to a bug in my wrapper script.
I managed to solve the first (and most serious) of the three
problems with the wrapper script. When using a SOCKS proxy
instead of port forwarding TLS certificate checking continues to
work. The two other problems remain, but are less serious.