[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Antwort: Re: Antwort: Re: Antwort: RE: FTP over proxy



Hans,

Let's see if we can figure this out:
Assumptions:
 The proxy address is used for both the proxy authentication and to send actual FTP commands to.
 The user and password for the proxy could be different from the user and password of the FTP server.
 Therefore we will need a new way to "login" but we already know how to do that, just that we have to treat the proxy slightly different.


Here is a suggestion (not sure this is exactly right or the best way to handle it):

Create a new parameter of wkSession called wkProxy. In this field keep a value that indicates possible different ways of using the proxy service. For now, it will only have two (maybe three) values.

D   wkProxy                     10I 0 INZ(0)

D NOPROXY         C                   const(0)    
D USERAFTERUSER   C                   const(1)
D GENUGATE        C                   const(278)        

Create a procedure similar to FTP_passiveMode that accepts the Proxy value for second parameter. If using proxy, set it by calling new procedure FTP_setProxy(GENUGATE). (basic code would be wkProxy = passedValue)

Look at procedure FTP_LoginLong. In there, you will find the code to login to a server.

Create a new procedure like that one that is called FTP_LoginProxy.

Create a section in the code that looks something like this:

Select
When  wkProxy = USERAFTERUSER (or GENUGATE);
 (dup the login part of FTP_LoginLong)
 (adjust error messages to reflect Proxy login errors)
 (If GENUGATE, accept the bad/no response to the login as being valid)
ENDSL

So, to use a proxy, your code would look something like this:
FTP_setProxy(GENUGATE);
Session = FTP_open("proxy host");
Rc = FTP_LoginProxy(session:user:pass);
Rc = FTP_Login(session: anon@xxxxxxxxxxxx: passIfRequired)

Might need some work but it looks like it might be functional.

Of course, you should post the code back to the forum once you have it tested.

Good luck. 


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Hans.Bertol@xxxxxx
Sent: Friday, July 08, 2011 5:48 AM
To: HTTPAPI and FTPAPI Projects
Subject: Antwort: Re: Antwort: Re: Antwort: RE: FTP over proxy

this sounds not good for me, 
is there any chance for us?

mit freundlichen Grüßen

Hans Bertol, ITF1
_________________________________
Hans Bertol
MAN Nutzfahrzeuge Österreich AG
Geschäftseinheit Spezialfahrzeuge
Factory IT Integration & Coordination (ITF1)
und
Notes Administration Österreich 
Brunner Strasse 44-50
1230  Wien 
Tel: +43-1-86631-2129 
Mob +43-664-1000934 
mailto:Hans.Bertol@xxxxxx



Scott Klement <sk@xxxxxxxxxxxxxxxx> 
Gesendet von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
07.07.2011 19:46
Bitte antworten an
HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>


An
HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Kopie

Thema
Re: Antwort: Re: Antwort: RE: FTP over proxy






You're right... now that I see the result, I see that it's not going to 
work.  Oh well, it was worth a try.

Hans, this isn't going to work unless you modify FTPAPI.


On 7/7/2011 3:42 AM, Hans.Bertol@xxxxxx wrote:
>
>     This work till the second login.
>     then the programm hangs
>     Code look now like this:
>     C                   EVAL      sess          = ftp_open(ProxyHost)
>
>     C                   IF        sess<  0
>
>     C                   EVAL      Msg           = ftp_errorMsg(0)
>
>     C                   RETURN
>     C                   ENDIF
>
>
>
>     C                   CALLP     ftp_Login(sess: ProxyUserId:
>     ProxyUsrPwd)
>
>
>     C                   EVAL      Login       = %Trim(UserId) + '@' + 
Host
>     C                   CALLP     ftp_Login(sess: Login)
>     C                   IF        sess<  0
>     C                   EVAL      Msg         = ftp_errorMsg(0)
>
>     C                   ENDIF
>
>     Log:
>     0: FTPAPI version 2.3 released on 2010-05-27
>     1: 220- GeNUGate-FTP-Relay OK.
>     1: 220- Authenticate with: pass
>     1: 220  OK
>     1:>  USER ua3hb
>     1: 331 Password required for method pass
>     1:>  PASS **********
>     1: 220- GeNUGate-FTP-Relay OK.
>     1: 220- Login with User@Host
>     1: 220- Please use Passive Mode (pasv)
>     1: 220  OK
>      *SYSTEM/ENDRQS        (after two minutes)
>     mit freundlichen Grüßen
>     Hans Bertol, ITF1
>     _________________________________
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------



********************************************

Die Firmendaten unserer Gesellschaften gemäß § 14 UGB finden Sie unter "Impressum" auf www.man.at.

This e-mail (including any attachments) is confidential and may be privileged. 
If you have received it by mistake, please notify the sender by e-mail and delete this message from your system. 
Any unauthorised use or dissemination of this e-mail in whole or in part is strictly prohibited. 
Please note that e-mails are susceptible to change. 
MAN Nutzfahrzeuge Österreich AG (including its group companies) shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt.
MAN Nutzfahrzeuge Österreich AG (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference.
 
******************************************** 
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------