There exist Explicit and Implicit FTPS (FTP-over-SSL). In first case connection is established (usually) to port 21, then a command is sent to negotiate SSL over established channel. Implicit SSL means connection over port (usually) 990, then SSL is negotiated and then regular commands (LOGIN etc. ) are sent over SSL-secured channel.
If you mix two modes (connect to port 990 in non-secured mode or try to connect to port 21 and start SSL handshake immediately), nothing will work.
So first thing to do is find out what mode you need to use. Then you set correct port and check that your library supports needed mode.