Quantcast
Channel: Chilkat Forum - latest questions
Viewing all 1061 articles
Browse latest View live

POST failured with big Content-Length - Integration with EWS Microsoft Exchange Server

$
0
0

I am try to teste integration with EWS WebServer (Use EWS to import an item by using the MIME stream) . In my test it works perfect up to 200k Content-Length.

Content greater than 200k I have problems. I try PostXml and SynchronousRequest But only small content works.

He does not even begin to negotiate NTLM.

Log Session:

---- Sending ----

POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip
Host: mail.MyServer.com.br
Content-Length: 286213

Debug Log:

PostXml:
    DllDate: May 25 2017
    ChilkatVersion: 9.5.0.68
    Architecture: Little Endian; 64-bit
    Language: Visual C++ 2015 / x64
    VerboseLogging: 1
    url: https://mail.MyServer.com.br/EWS/Exchange.asmx
    charset: utf-8
    HttpLogin: Serverteste
    A passpassword has been provided.
    urlObject_loadUrl:
        (leaveContext)
    finalizeRequestHeader:
        Auto-adding Host header.
        (leaveContext)
    fullRequest:
        findAddHttpConn:
            (leaveContext)
        httpRequest:
            httpVersion: 1.1
            verb: POST
            path: /EWS/Exchange.asmx
            contentType: text/xml; charset=utf-8
            charset: windows-1252
            sendCharset: 0
            mimeHeader: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Server - (www.Server.com.br)
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip
            requestParams:
                (leaveContext)
            (leaveContext)
        HttpOptions:
            AddHostHeader: 1
            AllowCookieResponseCaching: 0
            AllowGzip: 1
            CookieDir: 
            FollowRedirects: 1
            Login: Serverteste
            LoginDomain: MyServer
            AuthMethod: negotiate
            MaxResponseSize: 0
            MaxUrlLen: 2000
            PasswordLen: 9
            ReadTimeoutMs: 60000
            RequiredContentType: 
            ResumePoint: 0
            SaveCookies: 1
            SendBufferSize: 65535
            SendCookies: 1
            UnavailableRetryCount: 0
            UnavailableRetryWaitMs: 2000
            (leaveContext)
        a_synchronousRequest:
            generateRequestHeader:
                httpRequestGenStartLine:
                    authOnly: 0
                    hasMimeBody: 1
                    genStartLine:
                        startLine: POST /EWS/Exchange.asmx HTTP/1.1
                        (leaveContext)
                    (leaveContext)
                startLine: POST /EWS/Exchange.asmx HTTP/1.1
                genHeaderSb:
                    getMimeHeaderHttp:
                        headerField: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                        headerField: Connection: keep-alive
                        headerField: User-Agent: Server - (www.Server.com.br)
                        headerField: Accept-Language: en-us,en;q=0.5
                        headerField: Accept-Encoding: gzip
                        (leaveContext)
                    (leaveContext)
                addCookies:
                    Not auto-adding cookies.
                    sendCookies: 1
                    cookieDir: 
                    (leaveContext)
                m_host: mail.MyServer.com.br
                finalRequestHdr: Content-Type: text/xml; charset=utf-8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Server - (www.Server.com.br)
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip
Host: mail.MyServer.com.br
Content-Length: 286213
                (leaveContext 15ms)
            fullHttpRequest:
                domain: mail.MyServer.com.br
                port: 443
                ssl: 1
                openHttpConnection:
                    quickCloseHttpConnection:
                        (leaveContext)
                    Opening connection directly to HTTP server.
                    httpHostname: mail.MyServer.com.br
                    httpPort: 443
                    tls: 1
                    bUsingHttpProxy: 0
                    httpProxyAuthMethod: 
                    socket2Connect:
                        connect2:
                            hostname: mail.MyServer.com.br
                            port: 443
                            ssl: 1
                            connectImplicitSsl:
                                Clearing TLS client certificates.
                                connectSocket:
                                    domainOrIpAddress: mail.MyServer.com.br
                                    port: 443
                                    connectTimeoutMs: 30000
                                    connect_ipv6_or_ipv4:
                                        Multi-threaded domain to IP address resolution
                                        resolveHostname6:
                                            getAddressInfo:
                                                (leaveContext)
                                            (leaveContext)
                                        findIpAddrInfo:
                                            (leaveContext)
                                        connecting to IPV4 address...
                                        ipAddress: 177.128.175.98
                                        createSocket:
                                            Setting SO_SNDBUF size
                                            sendBufSize: 262144
                                            Setting SO_RCVBUF size
                                            recvBufSize: 4194304
                                            (leaveContext)
                                        connect:
                                            Waiting for the connect to complete...
                                            ck_getsockname_ipv4:
                                                (leaveContext)
                                            myIP: 172.16.90.50
                                            myPort: 63040
                                            socket connect successful.
                                            (leaveContext 16ms)
                                        (leaveContext 16ms)
                                    (leaveContext 16ms)
                                clientHandshake:
                                    The client cert chain is NULL.
                                    cacheClientCerts:
                                        Cached TLS client certificates.
                                        Client cert chain is NULL.
                                        (leaveContext)
                                    clientHandshake2:
                                        createRandom:
                                            (leaveContext)
                                        sendClientHello:
                                            TlsClientHello_buildMessage:
                                                (leaveContext)
                                            sendHandshakeMessages:
                                                (leaveContext)
                                            (leaveContext)
                                        readHandshakeMessages:
                                            processHandshakeRecord:
                                                processHandshakeMessage:
                                                    processServerHello:
                                                        negotiatedTlsVersion: TLS 1.2
                                                        negotiatedCipherSuite: TLS_RSA_WITH_AES_256_CBC_SHA
                                                        minAcceptableRsaKeySize: 1024
                                                        (leaveContext)
                                                    (leaveContext)
                                                processHandshakeMessage:
                                                    processIncomingCertificates:
                                                        loadX509DerAlt:
                                                            der_to_xml:
                                                                (leaveContext)
                                                            (leaveContext)
                                                        loadX509DerAlt:
                                                            der_to_xml:
                                                                (leaveContext)
                                                            (leaveContext)
                                                        loadX509DerAlt:
                                                            der_to_xml:
                                                                (leaveContext)
                                                            (leaveContext)
                                                        loadX509DerAlt:
                                                            der_to_xml:
                                                                (leaveContext)
                                                            (leaveContext)
                                                        (leaveContext)
                                                    (leaveContext)
                                                processHandshakeMessage:
                                                    (leaveContext)
                                                (leaveContext)
                                            (leaveContext 16ms)
                                        readHandshakeMessages:
                                            (leaveContext)
                                        handleServerCert:
                                            readHandshakeMessages:
                                                (leaveContext)
                                            (leaveContext)
                                        buildClientKeyExchange:
                                            buildClientKeyExchangeRsa:
                                                getServerCertPublicKey:
                                                    x509_getPublicKey:
                                                        (leaveContext)
                                                    (leaveContext)
                                                loadAnyDer:
                                                    DecodeToAsn:
                                                        (leaveContext)
                                                    loadAnyAsn:
                                                        loadRsaPkcs1Asn:
                                                            (leaveContext)
                                                        (leaveContext)
                                                    (leaveContext)
                                                modulus_bitlen: 2048
                                                bigEndian: 1
                                                padding: PKCS 1.5
                                                (leaveContext 15ms)
                                            (leaveContext 15ms)
                                        sendClientKeyExchange:
                                            sendHandshakeMessages:
                                                (leaveContext)
                                            (leaveContext)
                                        sendChangeCipherSpec:
                                            (leaveContext)
                                        derive_keys:
                                            initCrypt_aes2:
                                                (leaveContext)
                                            initCrypt_aes2:
                                                (leaveContext)
                                            (leaveContext)
                                        buildFinished:
                                            calc_finished:
                                                (leaveContext)
                                            (leaveContext)
                                        sendHandshakeMessages:
                                            (leaveContext)
                                        readHandshakeMessages:
                                            (leaveContext)
                                        readHandshakeMessages:
                                            processHandshakeRecord:
                                                processHandshakeMessage:
                                                    processFinished:
                                                        (leaveContext)
                                                    (leaveContext)
                                                (leaveContext 16ms)
                                            (leaveContext 16ms)
                                        calc_finished:
                                            (leaveContext)
                                        saveSecureRenegInfo:
                                            (leaveContext)
                                        (leaveContext 47ms)
                                    (leaveContext 47ms)
                                checkServerCert:
                                    Not verifying server certificate...
                                    Set the RequireSslCertVerify property to enable verification.
                                    (leaveContext)
                                checkServerCertRequirement:
                                    (leaveContext)
                                SSL/TLS Channel Established.
                                (leaveContext 63ms)
                            (leaveContext 63ms)
                        (leaveContext 63ms)
                    Turning on TCP_NODELAY.
                    socketOptions:
                        SO_SNDBUF: 262144
                        SO_RCVBUF: 4194304
                        TCP_NODELAY: 1
                        SO_KEEPALIVE: 1
                        (leaveContext)
                    HTTPS secure channel established.
                    (leaveContext 63ms)
                connectTime: Elapsed time: 63 millisec
                startLine: POST /EWS/Exchange.asmx HTTP/1.1
                fullRequestHeader:
                    requestHeader: Content-Type: text/xml; charset=utf-8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Server - (www.Server.com.br)
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip
Host: mail.MyServer.com.br
Content-Length: 286213
                    (leaveContext)
                computeRequestDataSize:
                    Request body is in a memory buffer..
                    (leaveContext)
                sendRequestHeader:
                    sendHeaderElapsedMs: 0
                    (leaveContext)
                sendRequestBody:
                    idleTimeoutMs: 60000
                    rqdType: 4
                    handleReceivedData:
                        Found end of response header...
                        (leaveContext)
                    sendBodyElapsedMs: 31
                    Failed to send HTTP request body.
                    quickCloseHttpConnection:
                        shutdownChannel:
                            (bForceClose) socket shutdown..
                            terminateConnection:
                                TCP connection cleanly closed by peer.
                                Cleanly terminated TCP connection.
                                (leaveContext 94ms)
                            Clearing TLS client certificates.
                            (leaveContext 94ms)
                        (leaveContext 94ms)
                    (leaveContext 125ms)
                (leaveContext 188ms)
            success: 0
            (leaveContext 203ms)
        success: 0
        (leaveContext 203ms)
    urlObject_loadUrl:
        (leaveContext)
    Failed.
    (leaveContext 219ms)

Is there a super fast way to detect if a URL is no longer valid?

$
0
0

When fetching feeds (for instance) sometimes a particular feed will have been discontinued and the URL is no longer valid. When I hit one of these the delay is equal to the connect timeout setting (say 5 seconds).

Is there a super fast way to detect if a URL is no longer valid?

Thanks!

Few Questions on Zipping using Chilkat ActiveX in Delphi

$
0
0

Hi,

I am trying out your ActiveX Zip component in Delphi. These are a few issues that are unclear.

1) 'OnProgressInfo' event gives 'File not found' for all skipped files, even if it is skipped due to open or access denied.

2) How to save zip on abort?

3) How to show progress of each data file? 'OnPercentDone' event is there for entire zip and not for single data file.

4) How to use ChilkatZip1.HeartbeatMs property and AbortCheck event.

How to convert CkByteData to byte array in Java

$
0
0

Hi, Can some one tell me the method to do this. When I use CkByteData's getBytes() or getData() I am getting syntax error as these functions are not returning Java byte array

The return email address when using a Hotmail account

$
0
0

Ok, so I have this code:

//  Set the SMTP server.
mailman.put_SmtpHost("smtp.live.com");

//  Set the SMTP login/password (if required)
mailman.put_SmtpUsername("xxx");
mailman.put_SmtpPassword("yyy");

//  Connect to SMTP port 465 using TLS.
mailman.put_SmtpSsl(true);
mailman.put_SmtpPort(25);

But, my account uses email aliases. So, I do this:

//  Create a new email object
CkEmail email;

email.put_Subject("Monthly workbook data");
email.put_Body("Please find attached the latest monthly workbook data.");
email.put_From("Andrew Truckle <ccc>");
success = email.AddTo("PTS Support", "ddd");
//  To add more recipients, call AddTo, AddCC, or AddBcc once per recipient.

The email sends through OK. But when I hit reply, it is going to xxx. It has not honoured the alias ccc I had specified. Why is this?

Compression with Encryption 6 times slower

$
0
0

The ActiveX Zip component (Delphi) slows down Six times, as compared to un-encrypted, if there are above 10,000 files.

Zipping attachments

$
0
0

At the moment I create a ZIP file myself using the Artpol Software library:

CZipArchive zipArchive;
zipArchive.Open(strBackupPath, CZipArchive::zipCreate);
zipArchive.SetGlobalComment(_T("Monthly Workbook Data"));
zipArchive.AddNewFile(strMWBFile, CZipCompressor::levelDefault, false);
zipArchive.Close();

//  Add some attachments.
//  The AddFileAttachment method returns the value of the content-type it chose for the attachment.
const wchar_t *contentType = email.addFileAttachment(strBackupPath);

It was bought to my attention that the CkEmailW object has a ZipAttachments method. I have some questions about it:

  1. Is it possible for us to support adding a global comment?
  2. Is it possible for us to support specifying the compression level?
  3. Does it matter what content the attachments are? Mine will be Unicode or UTF8 text files in up to 40 languages.

Thanks for the clarification. This is so I can decide if there will be an advantage to using ZipAttachments as opposed to my own methodology.

Thanks.

Progress monitoring for sending emails with attachments?

$
0
0

Is it possible to support some kind of progress monitoring when creating an email, attaching the file and then sending it and closing the connection?

OK, I have located this in the documentation for an eventProgressInfo. How do I go about using these call backs please? I am using the Unicode library with Visual C++ MFC Visual Studio 2017.

Thanks in advance.


Using my own OAuth2 token with mailman?

$
0
0

I have looked at the documentation about GMail and I quote:

GMail: If sending via smtp.gmail.com, then send with OAuth2 authentication if possible. Otherwise you will need to change your GMail account settings to allow for sending by less secure apps. See the links below.

I have reviewed the sample code that uses your HTTP library for the task in hand. However, I am already having to fund the Email library and at the moment it is beyond my circumstances to purchase an additional library.

Now, I have already written my own VB.NET utility to communicate with a GMail Calendar and I do the authentication like this:

Private Function DoAuthentication(ByRef rStrToken As String, ByRef rParameters As OAuth2Parameters) As Boolean
    Dim credential As UserCredential
    Dim Secrets = New ClientSecrets() With {
        .ClientId = m_strClientID,
        .ClientSecret = m_strClientSecret
    }
    'm_Scopes.Add(CalendarService.Scope.Calendar)
    m_Scopes.Add("https://www.googleapis.com/auth/calendar https://www.google.com/m8/feeds/")

    Try
        credential = GoogleWebAuthorizationBroker.AuthorizeAsync(Secrets, m_Scopes,
                                                                 "user", CancellationToken.None,
                                                                 New FileDataStore("PublicTalkSoftware.Calendar.Application")).Result()

        ' Create the calendar service using an initializer instance
        Dim initializer As New BaseClientService.Initializer() With {
            .HttpClientInitializer = credential,
            .ApplicationName = "GoogleCalIF"
        }
        m_Service = New CalendarService(initializer)

        rStrToken = credential.Token.AccessToken.ToString()
        rParameters.AccessToken = credential.Token.AccessToken
        rParameters.RefreshToken = credential.Token.RefreshToken
    Catch ex As Exception
        ' We encountered some kind of problem, perhaps they have not yet authenticated?
        ' Can we isolate that as the exception?

        Return False
    End Try

    Return True
End Function

So what I am asking is if they is a similar way that I can do the authentication bit myself so that I can just pass the token needed into the mailman object?

Thanks.

CkCrypt2__mySqlAesEncrypt with unicode chars

$
0
0

Hello Everybody! I use Delphi 10. My MySQL server use UTF-8 codepage, I try execute AES_ENCRYPT function and CkCrypt2mySqlAesEncrypt, but I get various results, because the CkCrypt2mySqlAesEncrypt function uses the ANSI encoding. When decrypting CkCrypt2mySqlAesDecrypt, I get only the question marks. How to implement AES-128-CBC crypt like MySQL AES_ENCRYPT with UTF-8 encoding? I could use CkCrypt2encryptStringENC, but I dont know which IV parameter uses AES_ENCRYPT.

Bug in Chilkat.HttpRequest Content-Length?

$
0
0

Hi.

I'm not sure what's the exactly problem here but I think it has something to do with the Encoding. I've used Firefox and the .NET Framework built-in HttpRequestMessage and both tell me that the Content-Length for this form data is 7 but Chilkat will make 9 out of it. Probably because of the "%20" space encoding. But if I send 9 to the server, he will reject the request.

 static void Main(string[] args)
    {
        // Set up some things
        const string logFileName = "log.txt";

        var url = new Uri("http://www.example.net/");

        var formData = new Dictionary<string, string>
        {
            ["space"] = " ",
        };

        // .NET Framework
        var request = new HttpRequestMessage(HttpMethod.Post, url)
        {
            Content = new FormUrlEncodedContent(formData)
        };

        File.AppendAllText(logFileName, $"Content-Length: {request.Content.Headers.ContentLength}");

        // Chilkat
        var http = new Http {SessionLogFilename = logFileName};
        http.UnlockComponent("test");

        var chilkatRequest = new HttpRequest
        {
            HttpVerb = "POST",
            ContentType= "application/x-www-form-urlencoded"
        };

        foreach (var pair in formData)
        {
            chilkatRequest.AddParam(pair.Key, pair.Value);
        }

        var response = http.SynchronousRequest(url.Host, 80, false, chilkatRequest);

        // See both results
        Process.Start(logFileName);
    }

Thanks in advance.

TCL SFTP example not working

$
0
0

I was following an TCL SFTP example provided by this ChilKat example. The firewall of my servers are disabled and it seems that script fails at CkSFtp_Connect level and never proceeds to the authentication. I attached the chilkat log output below. The log file doesn't seem to indicate any error. Any help is appreciated! thank you.

connecting ChilkatLog: Connect_SFtp: DllDate: May 26 2017 ChilkatVersion: 9.5.0.68 UnlockPrefix: Anything for 30 day trial Architecture: Little Endian; 64-bit Language: Linux Tcl VerboseLogging: 0 SftpVersion: 0 connectInner: sshConnect: Established TCP/IP connection with SSH server --sshConnect sshSetupConnection: clientIdentifier: SSH-2.0-PuTTY_Release_0.69 Sending client identifier... Done sending client identifier. Reading server version... initialDataFromSshServer: SSH-2.0-OpenSSH_6.6.1

    serverVersion: SSH-2.0-OpenSSH_6.6.1
    KeyExchangeAlgs:
      algorithm: curve25519-sha256@libssh.org
      algorithm: ecdh-sha2-nistp256
      algorithm: ecdh-sha2-nistp384
      algorithm: ecdh-sha2-nistp521
      algorithm: diffie-hellman-group-exchange-sha256
      algorithm: diffie-hellman-group-exchange-sha1
      algorithm: diffie-hellman-group14-sha1
      algorithm: diffie-hellman-group1-sha1
    --KeyExchangeAlgs
    HostKeyAlgs:
      algorithm: ssh-rsa
      algorithm: ecdsa-sha2-nistp256
      algorithm: ssh-ed25519
    --HostKeyAlgs
    EncCS:
      algorithm: aes128-ctr
      algorithm: aes192-ctr
      algorithm: aes256-ctr
      algorithm: arcfour256
      algorithm: arcfour128
      algorithm: aes128-gcm@openssh.com
      algorithm: aes256-gcm@openssh.com
      algorithm: chacha20-poly1305@openssh.com
      algorithm: aes128-cbc
      algorithm: 3des-cbc
      algorithm: blowfish-cbc
      algorithm: cast128-cbc
      algorithm: aes192-cbc
      algorithm: aes256-cbc
      algorithm: arcfour
      algorithm: rijndael-cbc@lysator.liu.se
    --EncCS
    EncSC:
      algorithm: aes128-ctr
      algorithm: aes192-ctr
      algorithm: aes256-ctr
      algorithm: arcfour256
      algorithm: arcfour128
      algorithm: aes128-gcm@openssh.com
      algorithm: aes256-gcm@openssh.com
      algorithm: chacha20-poly1305@openssh.com
      algorithm: aes128-cbc
      algorithm: 3des-cbc
      algorithm: blowfish-cbc
      algorithm: cast128-cbc
      algorithm: aes192-cbc
      algorithm: aes256-cbc
      algorithm: arcfour
      algorithm: rijndael-cbc@lysator.liu.se
    --EncSC
    MacCS:
      algorithm: hmac-md5-etm@openssh.com
      algorithm: hmac-sha1-etm@openssh.com
      algorithm: umac-64-etm@openssh.com
      algorithm: umac-128-etm@openssh.com
      algorithm: hmac-sha2-256-etm@openssh.com
      algorithm: hmac-sha2-512-etm@openssh.com
      algorithm: hmac-ripemd160-etm@openssh.com
      algorithm: hmac-sha1-96-etm@openssh.com
      algorithm: hmac-md5-96-etm@openssh.com
      algorithm: hmac-md5
      algorithm: hmac-sha1
      algorithm: umac-64@openssh.com
      algorithm: umac-128@openssh.com
      algorithm: hmac-sha2-256
      algorithm: hmac-sha2-512
      algorithm: hmac-ripemd160
      algorithm: hmac-ripemd160@openssh.com
      algorithm: hmac-sha1-96
      algorithm: hmac-md5-96
    --MacCS
    MacSC:
      algorithm: hmac-md5-etm@openssh.com
      algorithm: hmac-sha1-etm@openssh.com
      algorithm: umac-64-etm@openssh.com
      algorithm: umac-128-etm@openssh.com
      algorithm: hmac-sha2-256-etm@openssh.com
      algorithm: hmac-sha2-512-etm@openssh.com
      algorithm: hmac-ripemd160-etm@openssh.com
      algorithm: hmac-sha1-96-etm@openssh.com
      algorithm: hmac-md5-96-etm@openssh.com
      algorithm: hmac-md5
      algorithm: hmac-sha1
      algorithm: umac-64@openssh.com
      algorithm: umac-128@openssh.com
      algorithm: hmac-sha2-256
      algorithm: hmac-sha2-512
      algorithm: hmac-ripemd160
      algorithm: hmac-ripemd160@openssh.com
      algorithm: hmac-sha1-96
      algorithm: hmac-md5-96
    --MacSC
    CompCS:
      algorithm: none
      algorithm: zlib@openssh.com
    --CompCS
    CompSC:
      algorithm: none
      algorithm: zlib@openssh.com
    --CompSC
    ChosenIncomingEncryption: chacha20-poly1305@openssh.com
    ChosenOutgoingEncryptoin: chacha20-poly1305@openssh.com
    ChosenIncomingMac: hmac-sha1
    ChosenOutgoingMac: hmac-sha1
    ChosenIncomingCompression: none
    ChosenOutgoingCompression: none
    ChosenKexAlgorithm: curve25519-sha256@libssh.org
    ChosenHostKeyAlgorithm: ssh-rsa
    Using SHA256 for Key Exchange Hash
    verifyHostKey:
      rsaHostKeyVerify:
        alg: ssh-rsa
      --rsaHostKeyVerify
    --verifyHostKey
    Sending newkeys to server...
    Expecting newkeys from server...
    SSH Key Exchange Success.
    installNewKeys:
      m_isRekey: 0
      No outgoing compression.
      No incoming compression.
      Outgoing encryption is now chacha20-poly1305@openssh.com
      Incoming encryption is now chacha20-poly1305@openssh.com
    --installNewKeys
  --sshSetupConnection
  socketOptions:
    SO_SNDBUF: 425984
    SO_RCVBUF: 425984
    TCP_NODELAY: 1
    SO_KEEPALIVE: 0
  --socketOptions
--connectInner
Success.   --Connect_SFtp

--ChilkatLog

GetFile fails, but file downloaded successfully; wrong expectedByteCount; right downloadedByteCount

$
0
0

I've upgraded my ftp2 activex control at the last version in last days; during my tests in some case I had some GetFile error message that with earlier version I did not have; there were messages like the one following. As you see: 1) Xml report says that "226-File successfully transferred" 2) Xml report says that "<downloadedbytecount>43</downloadedbytecount>" 3) Xml report says that "<expectedbytecount>325985</expectedbytecount>" so it seems that this error is about "<error>Downloaded byte count less than expected byte count.</error>" 4) But if I call Ftp.GetSizeByName, I've exactly the dimension corresponding to "<downloadedbytecount>" Have you ever find siyuation like this? Thank you

<ChilkatLog>
    <GetFile>
        <DllDate>May 25 2017</DllDate>
        <ChilkatVersion>9.5.0.68</ChilkatVersion>
        <Architecture>Little Endian; 32-bit</Architecture>
        <Language>.NET 4.0</Language>
        <VerboseLogging>0</VerboseLogging>
        <ProgressMonitoring>
            <enabled>yes</enabled>
            <heartbeatMs>0</heartbeatMs>
            <sendBufferSize>65536</sendBufferSize>
        </ProgressMonitoring>
        <downloadToFile>
            <localFilename>C:\Copatlife\PIGRECO_UPD\201706271737_TMP\MOBILGAM_PI_HORIZON\CONFIGURAZIONE\TypologyGroupList.ARG.BAK</localFilename>
            <downloadToOutput2>
                <modeZ>0</modeZ>
                <binaryMode>1</binaryMode>
                <setupDataConnection>
                    <info>passive transfer mode</info>
                    <setupPassiveDataSocket>
                        <sendCommand>
                            <sendingCommand>PASV</sendingCommand>
                        </sendCommand>
                        <readCommandResponse>
                            <replyLineQP>227 Entering Passive Mode (62,149,141,10,191,120)</replyLineQP>
                        </readCommandResponse>
                        <dataConnect>
                            <hostname>62.149.141.10</hostname>
                            <port>49016</port>
                            <socketOptions>
                                <SO_SNDBUF>262144</SO_SNDBUF>
                                <SO_RCVBUF>4194304</SO_RCVBUF>
                                <TCP_NODELAY>0</TCP_NODELAY>
                                <SO_KEEPALIVE>0</SO_KEEPALIVE>
                            </socketOptions>
                            <dataConnectSuccess>1</dataConnectSuccess>
                        </dataConnect>
                    </setupPassiveDataSocket>
                </setupDataConnection>
                <sendCommand>
                    <sendingCommand>RETR TypologyGroupList.ARG.BAK</sendingCommand>
                </sendCommand>
                <readCommandResponse>
                    <replyLineQP>150 Accepted data connection</replyLineQP>
                </readCommandResponse>
                <downloadRate>0</downloadRate>
                <totalNumBytesReceived>43</totalNumBytesReceived>
                <receiveTimeMs>Elapsed time: 31 millisec</receiveTimeMs>
                <info>Data connection closed.</info>
                <readCommandResponse>
                    <replyLineQP>226-File successfully transferred</replyLineQP>
                    <replyLineQP>226 0.000 seconds (measured here), 130.37 Kbytes per second</replyLineQP>
                </readCommandResponse>
                <error>Downloaded byte count less than expected byte count.</error>
                <downloadedByteCount>43</downloadedByteCount>
                <expectedByteCount>325985</expectedByteCount>
            </downloadToOutput2>
            <downloadToOutput>Elapsed time: 93 millisec</downloadToOutput>
        </downloadToFile>
        <error>Failed.</error>
    </GetFile>
</ChilkatLog> 

Where is CkAesInterop

$
0
0

Hi I am trying to upgrade to newer Chilkat C++ library. The code uses CkAesInterop - CkAesInterop::Md5

Where is CkAesInterop.h?

With regards

convert php encyption to powerbuilder

$
0
0

Anyone can help me to convert "php encryption" to "powerbuilder" using chilkat??. below the code that i want to convert

// Encryption Function =========== function mc_encrypt($data, $key) { /// make binary representasion of $key $key = hex2bin($key);

/// check key length, must be 256 bit or 32 bytes if (mb_strlen($key, "8bit") !== 32) { throw new Exception("Needs a 256-bit key!");}

// create initialization vector $iv_size = openssl_cipher_iv_length("aes-256-cbc"); $iv = openssl_random_pseudo_bytes($iv_size);

/// encrypt $encrypted = openssl_encrypt($data, "aes-256-cbc", $key, OPENSSL_RAW_DATA, $iv );

/// create signature, against padding oracle attacks $signature = mb_substr(hash_hmac("sha256", $encrypted, $key, true),0,10,"8bit");

/// combine all, encode, and format $encoded = chunk_split(base64_encode($signature.$iv.$encrypted));

return $encoded; }

// Decryption Function ========== function mc_decrypt($str, $key) {

/// make binary representation of $key $key = hex2bin($key);

/// check key length, must be 256 bit or 32 bytes if (mb_strlen($key, "8bit") !== 32) { throw new Exception("Needs a 256-bit key!"); }

/// calculate iv size $iv_size = openssl_cipher_iv_length("aes-256-cbc");

/// breakdown parts $decoded = base64_decode($str); $signature = mb_substr($decoded,0,10,"8bit"); $iv = mb_substr($decoded,10,$iv_size,"8bit"); $encrypted = mb_substr($decoded,$iv_size+10,NULL,"8bit");

/// check signature, against padding oracle attack $calc_signature = mb_substr(hash_hmac("sha256", $encrypted, $key, true),0,10,"8bit");

if(!mc_compare($signature,$calc_signature)) { return "SIGNATURE_NOT_MATCH"; /// signature doesn't match }

$decrypted = openssl_decrypt($encrypted, "aes-256-cbc", $key, OPENSSL_RAW_DATA, $iv);

return $decrypted; }

/// Compare Function ============ function mc_compare($a, $b) { /// compare individually to prevent timing attacks

/// compare length if (strlen($a) !== strlen($b)) return false;

/// compare individual $result = 0; for($i = 0; $i < strlen($a); $i ++) { $result |= ord($a[$i]) ^ ord($b[$i]); }

return $result == 0; }


Bounce type 6

$
0
0

Hi,

What's give bounce type = 6 in an email ?

Return-Path ?

Please help!

Chilkat SSH commands shows in output

$
0
0

Hello, I would like to get rid of the commands I am executing on device. I have Windows user form and when I am sending commands to the switch in the output except the results or action which the application did on the device I also see commands / config. I want to get rid of them and show only result of these commands.

            /*THIS IS THE SET OF COMMANDS I WANT TO RUN */
            ssh2.ChannelSendString(channelNum, command, "ansi");

            if (success != true)
            {
                if (x < 2)
                {
                    output_box.Invoke((MethodInvoker)delegate
                    {
                        // Running on the UI thread
                        output_box.Text += "\r\n Execution of commands failed \r\n Running again ...\r\n";
                        tofile += "\r\n Session failed \r\n Running again ...\r\n ";
                    });
                    x++;
                    i--;
                    continue;
                }
            }

            ssh2.ChannelSendEof(channelNum);
            var cmdOutput = ssh2.ChannelReadAndPoll(channelNum, 2000);
            var result = ssh2.GetReceivedText(channelNum, "ansi");
            tofile += result;

            output_box.Invoke((MethodInvoker)delegate {
                // Running on the UI thread
                output_box.Text += result;
            });

So what I see in the output_box is this -> how do I get rid of the first four lines starting with ,,conf t" and ending with ,,end"

############### SWITCH ##################### - 1 of 2

conf t
vlan 20
name 20
end

SWITCH# conf t

Enter configuration commands, one per line. End with CNTL/Z.

SWITCH(config)# vlan 20

SWITCH(config-vlan)# name 20

SWITCH(config-vlan)# end

SWITCH#

Problems with AddRelatedFile2

$
0
0

I'm trying to send emails with a signature, it's a JPG file, and I want to embed in email foot.

I'm writing one cid in Html code img src='cid:Signature'

And after I make ::oMail:AddRelatedFile2( cSignatureFile, "Signature" )

However the email is received, the file is attached, but there is a "missing image" block in the body where the image is supposed to be in the body of the mail?

Wath's the problem.

Thanks.

How can the relative addressing work? Assuming the example is correct... or what else could be wrong?

Thanks!

Cannot connect to Win IoT Ftp server

$
0
0

I am attempting to connect to RaspberryPi 3 Windows 10 IoT which is running ftpd. I can connect to it using Filezilla without any issues. I installed the latest from NuGet in Visual Studio 2017 Enterprise.

Below is the sample code I am using to attempt to connect. It fails at ftp.ConnectAsync() with:

ChilkatLog: Connect_Ftp2: DllDate: May 29 2017 ChilkatVersion: 9.5.0.68 UnlockPrefix: Anything for 30-day trial Architecture: Little Endian; 32-bit VerboseLogging: 0 ProgressMonitoring: enabled: yes heartbeatMs: 0 sendBufferSize: 65536 --ProgressMonitoring ImplicitSsl: 0 AuthTls: 0 AuthSsl: 0 ftpConnect: Hostname: 10.200.10.207 Port: 21 IdleTimeoutMs: 60000 readCommandResponse: Failed to receive more bytes. Failed to read FTP control channel reply. --readCommandResponse initialStatus: 0 initialResponse: --ftpConnect Failed to connect to FTP server. Failed. --Connect_Ftp2 --ChilkatLog


           Chilkat.Ftp2 ftp = new Chilkat.Ftp2();

            bool success;

            //  Any string unlocks the component for the 1st 30-days.
            success = ftp.UnlockComponent("Anything for 30-day trial");
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            ftp.Hostname = "10.200.10.207";
            ftp.Username = "User";
            ftp.Password = "Password";
            ftp.Port = 21;

            //  Connect and login to the FTP server.
            success = await ftp.ConnectAsync();
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  Set the transfer mode to ASCII
            success = await ftp.SetTypeAsciiAsync();
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  Change to the remote directory where the file will be uploaded.
            success = await ftp.ChangeRemoteDirAsync("junk");
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  Upload a file.
            string localFilename = "hamlet.xml";
            string remoteFilename = "hamlet.xml";

            //  Turn on session logging for the upload:
            ftp.KeepSessionLog = true;

            success = await ftp.PutFileAsync(localFilename, remoteFilename);
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  View the session log.  You can verify visually that
            //  the transfer was in ascii mode.
            Debug.WriteLine(ftp.SessionLog);

            success = await ftp.DisconnectAsync();

            Debug.WriteLine("File Uploaded!");

C# HTTP DownloadASync Timeout returning success

$
0
0

I am downloading a large file and pulling the ethernet cable midway,

Task task = _http.DownloadAsync(url, zipDestination); task.Run();

When finished, task.StatusInt is still returning a value of 7 / Success

Should I be checking something else? Ex BgPercentDone

Viewing all 1061 articles
Browse latest View live