Quantcast
Channel: Chilkat Tech Notes
Viewing all 414 articles
Browse latest View live

SocketError: WSANO_DATA The requested name is valid, but no data of the requested type was found.

$
0
0

Question:

I get the following error in the LastErrorText for domain “something.com”.

…
    connectSocket:
      connect_ipv6_or_ipv4:
        resolveHostname6:
          getAddressInfo:
            Failed to get host address info. (3)
            SocketError: WSANO_DATA The requested name is valid, but no data of the requested type was found.
            WSANO_DATA typically indicates a problem with DNS -- possibly a missing CNAME record for the host.
            hostOrIpAddr: something.com
            port: 587
            Versions of Windows earlier than Windows XP are limited to handling IPv4 only
            On Windows Server 2003 and Windows XP, IPv6 addresses are returned only if IPv6 is installed on the local computer.
          --getAddressInfo
        --resolveHostname6
        Domain to IP address resolution failed.
      --connect_ipv6_or_ipv4
    --connectSocket
…

How do I resolve this problem?

Answer:

One possibility is that no DNS records actually exist for the domain name. In other words, the domain name does not resolve to any IP address.
Another, more likely possibility is that this is a network/DNS problem specific to your computer or local network. For example, if you open a shell session or DOS command prompt and type

nslookup something.com

It should fail. If it works from some other computer located on some other network, then you know the problem is specific to your local network. The problem is not in Chilkat or your application, it’s a problem for a system/network administrator to fix.


Visual Foxpro IDE crashes when using asynchronous socket methods

$
0
0

Question:

When using asynchronous socket methods, VFP crashes.

Try running the code from the example under VFP https://www.example-code.com/foxpro/socket_async.asp

What else do I need to configure?

Answer:

The older IDE’s such as VB6 and FoxPro don’t take kindly to background threads.  The solution is to clean up the threads at the end of your program by doing this:

loGlobal = CreateObject('Chilkat_9_5_0.Global')
lnSuccess = loGlobal.FinalizeThreadPool()

 

 

Install 32-bit ActiveX and Verify Install

$
0
0

This post shows how to install the 32-bit Chilkat ActiveX using the 32-bit MSI installer here:   https://www.chilkatsoft.com/downloads_ActiveX.asp

Step 1.

Download and run the MSI installer.

Step 2.

In Windows Explorer, navigate to C:\Program Files (x86)\Chilkat Software, Inc\Chilkat 32-bit ActiveX

Double-click on CheckChilkatActiveX.exe 

You should see the following dialog:

Step 3.

Choose an ActiveX class from the “Choose an ActiveX Object” dropdown.  For example, choose Chilkat_9_5_0.Asn.   Then click on “Check the ActiveX Object Registration”.   You will see the following if the ActiveX was registered system-wide Local Machine registry (i.e. for all Windows users).   For more information about the Current User vs. Local Machine registries, see this:  https://chilkatsoft.com/activex_dll_registration_3.asp

Step 4: 

If the ActiveX was not registered to the Local Machine registry, check to see if it was registered to the Current User registry.

Go ahead and check the “Check per-user registration” checkbox.  Then click again on the “Check the ActiveX Object Registration” button.   Now you are checking the Current User registry (the registry specific to your logged on user account).

GMail SMTP

$
0
0

Question:

I am trying to send email via GMail using the SMTP protocol.  I am sending the correct GMail login credentials, but I get this error:

...
smtpAuthenticate:
login_method: LOGIN
auth_login:
  smtpSendGet2:
    sendCmdToSmtp:
      SmtpCmdSent: AUTH LOGIN
    --sendCmdToSmtp
    readSmtpResponse:
      SmtpCmdResp: 334 VXNlcm5hbWU6
    --readSmtpResponse
  --smtpSendGet2
  sendCmdToSmtp:
    SmtpCmdSent: ***
  --sendCmdToSmtp
  readSmtpResponse:
    SmtpCmdResp: 334 UGFzc3dvcmQ6
  --readSmtpResponse
  sendCmdToSmtp:
    SmtpCmdSent: {PasswordOrCredentials}
  --sendCmdToSmtp
  readSmtpResponse:
    SmtpCmdResp: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbsG
    SmtpCmdResp: 534-5.7.14 n5rYM4PYxPR7YqQVlbTxdmbVimcii93TX6k3aJfKcd8hxX2ZWmUoO-2Giu8N_A5HA827H6
    SmtpCmdResp: 534-5.7.14 …
    SmtpCmdResp: 534-5.7.14 …
    SmtpCmdResp: 534-5.7.14 srCFutiZ4TpRrybTHxXsHbPI9ZJwwT1jcgBndgFUxr-wzlktVW> Please log in via
    SmtpCmdResp: 534-5.7.14 your web browser and then try again.
    SmtpCmdResp: 534-5.7.14  Learn more at
    SmtpCmdResp: 534 5.7.14  https://support.google.com/mail/answer/78754 v76sm3334299pfj.145 - gsmtp
  --readSmtpResponse
...

Answer:

SMTP LOGIN authentication (using a login and password over TLS) is considered by Google to be “less secure”.  Therefore, the GMail account needs to be configured for “less secure apps”.  The GMail account owner can do it here:  https://myaccount.google.com/lesssecureapps

There are two alternatives that don’t require the GMail account to be configured for “less secure apps”.

  1. Use OAuth2 authentication.  This requires an initial step that displays a web browser allowing the GMail account owner to authorize the application for sending email.  The result of this authorization is an access token that is used for SMTP OAuth2 authentication (rather than using a login/password).  The access token will need to be periodically refreshed, but the refresh can be done without GMail account owner interaction.  (In other words, displaying the web browser is a 1-time action.  The access token obtained from the authorization is persisted to a database, file, etc. so that it is re-used and refreshed as needed for all future SMTP sessions.)
    See: Get GMail SMTP OAuth2 Access Token for Desktop App
    GMail SMTP Send using Previously Obtained OAuth2 Access Token
    Refresh GMail SMTP OAuth2 Access Token
    OAuth2 for a GMail using a Service Account Key
  2. Use GMail Rest API.  It is also possible to send email using the GMail REST API.  This is sending email via HTTPS as opposed to using the SMTP protocol.
    See examples here:  https://www.example-code.com/csharp/gmail.asp
    (The same GMail REST API examples are available for many other programming languages under the “GMail REST API” category on example-code.com.)

 

 

Chilkat v9.5.0.76 Release Notes

$
0
0

The v9.5.0.75 release notes are available here: Chilkat v9.5.0.75 Release Notes

v9.5.0.76 Release Notes:

  • Csr: The Certificate Signing Request class (Csr) now supports ECC based certificates.
  • (bug fix) Xml: For the HasChildWithTag method, if the tagPath ended with array brackets, then the method failed. For example, if the tagPath was “something[i]”, then it did not work. If however, the tagPath was “something[i]|another”, then it worked.
  • Delphi DLL: Added an alternative download that utilizes a Dynamic Loader.
  • FTP2: Changed the default value of PassiveUseHostAddr to True. Also added internal logic to automatically discover what’s needed, so the value of this property should very rarely matter, if ever.
  • DirTree: Rewritten internally to avoid all recursion (so there is never a chance of the stack being blown).
  • Xojo: The 32-bit Linux build did not work because the directory name used within the chilkat.xojo_plugin was “Linux x86”, but needed to be “Linux X86”. The capitalized “X” is needed and matters.
  • Rest: The auto reconnect capability is improved. (This is an internal enhancement.)
  • Ftp2, SFtp: Added the SyncMustMatchDir and SyncMustNotMatchDir properties.
  • PHP 7.3 is now supported.
  • (These release notes are unfinished. More notes will be available soon…)

SSH Authentication Options in sshd_config

$
0
0

The /etc/ssh/sshd_config file has an entry called AuthenticationMethods.

Typically you would enter either:

AuthenticationMethods "password"

or

AuthenticationMethods "publickey"

to indicate which authentication method should be required. You can also enter:

AuthenticationMethods "password" "publickey"

to indicate that either authentication method should be required. You can also enter:

AuthenticationMethods "publickey,password"

to indicate that both authentication methods should be required.

  • If a server requires both publickey and password, then call AuthenticatePwPk.
  • If a server accepts only password authentication, then call AuthenticatePw.
  • If a server accepts only publickey authentication, then call AuthenticatePk.
  • If the server allows either publickey OR password authentication, then any of AuthenticatePw, AuthenticatePk, or AuthenticatePwPk may be called.

Chilkat v9.5.0.77 Pre-Release Notes

$
0
0

This is an up-to-date tally of fixes, changes, and additions to v9.5.0.77, which will be released in March 2019. Send email to support@chilkatsoft.com if a pre-release is needed. Make sure to specify programming language, operating system, and all other information required to know the specific build required, such as any of the following: Visual Studio version, .NET Framework version, JDK version, PHP version, 32-bit/64-bit, Python version, Ruby version, or anything else that may apply.

The v9.5.0.76 release notes are available here: Chilkat v9.5.0.76 Release Notes

v9.5.0.77 Pre-Release Notes:

  • Email: The NumRelatedItems property was 1 too large in some cases.
  • Bz2: PercentDone callbacks were not working.
  • MailMan: If the connection is idle for 1 minute or more, the next email sent will automatically use a fresh connection. (When a method to send email is called, such as SendEmail, the connection is kept open for the possibility that another call to SendEmail can use the same open connection. Quite often, the server disconnects from an idle connection and the next call to SendEmail fails. This new behavior eliminates this possibility (for the most part). Applications can always explicitly close the SMTP connection by calling CloseSmtpConnection.)
  • Objective-C on MacOSX, iOS, watchOS, and tvOS: Non-english directories were not created properly (specifically Japanese chars were the test case, but the problem certainly existed for all non-English chars). This caused methods such as Unzip to not work correctly.
  • Xml: Added the following methods and properties: GetChildAttrValue, TagUnpEquals, TagNsEquals, TagUnprefixed, and TagNsPrefix.
  • StringBuilder: Added the following methods: GetBefore, RemoveBefore, GetAfterFinal, RemoveAfterFinal, and ReplaceFirst.
  • Rest: Added the DebugMode property and the GetLastDebugRequest method. This allows for an application to get the exact request sent in the last call to a FullRequest* or SendReq* method.
  • Scp: If an upload succeeds, but the only failure is in setting the remote file time, then the method will return success rather than failure.
  • Email: CreateReply did not automatically drop attachments in the reply email that is returned.
  • Http: For methods that return an HttpResponse object, if the response status code was >= 400, the response body (if it exists) was not contained in the responseObject.BodyStr property. Now it is.
  • SFtp: The SFtp.SyncedFiles property contains a list of files (one per line) uploaded or downloaded in the last call to SyncTreeUpload or SyncTreeDownload. For SyncTreeDownload, this list can also include local directories that were created. Starting in v9.5.0.77, the local directory entries will end with “/” to signify a directory.
  • BinData: Added the following methods: AppendByte, AppendInt2, AppendInt4.
  • Imap: The HasCapability method returned an incorrect answer if the capability in question was the last one listed in the IMAP server’s capability response and a CRLF followed. For example, querying for “QUOTA” — if the capability string ends with “QUOTA\r\n”, such as “* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS …. SPECIAL-USE QUOTA\r\n”, then HasCapability would return False/0.
  • Ftp2: In certain circumstances, when re-connecting using the same Ftp2 object instance, Chilkat would try to use SSL/TLS for the data connection for a case where it should not. This is fixed.
  • Xml: Fixed: LoadXml with autoTrim=false would introduce an extra leading SPACE character in the content. For example: <a>{SPACE}123</a> would become <a>{SPACE}{SPACE}123</a> (where {SPACE} represents a single SPACE char). This would only happen to nodes with a leading SPACE char in the content. For example, <a>123</a> would be unaffected.
  • Xml: Added the RemoveStyleSheet method.

RegFree COM / Using OCX Files with SxS Technology in VB6

$
0
0

This blog post serve’s as Chilkat’s bookmark/reminder to this tutorial:

http://www.vbforums.com/showthread.php?852949-VB6-Tutorial-Using-OCX-Files-with-SxS-Technology

It shows how to use the Chilkat ActiveX DLL with a VB6 application in such a way that the DLL can be located (side-by-side) with the .exe and no Windows registration is necessary.

It requires a manifest XML file, which can be downloaded here: https://www.chilkatdownload.com/chilkat_activex_manifest.zip

I have actually (yet) stepped through the tutorial to accomplish the task, but other customers have:

Thank you very much for the Manifest file. This seems to solve the problem. I used this tutorial to reference your ActiveX DLL in my VB6 project with your Manifest file : http://www.vbforums.com/showthread.php?852949-VB6-Tutorial-Using-OCX-Files-with-SxS-Technology
It seems to work perfectly.


One Note: An OCX is a DLL based upon the COM (Component Object Model) technology and is often referred to as ActiveX control. In general, a DLL can be based upon any number of technologies, including COM, .NET, standard Windows libraries, etc.

The Chilkat ActiveX DLL *is* an OCX. Sometimes you’ll see the .ocx file extension used instead of .dll. The Chilkat ActiveX DLL uses the “.dll” file extension.


Chilkat v9.5.0.78 pre-Release Notes

$
0
0

This post is a running tally of updates, fixes, and new features as the development of v9.5.0.78 progresses. New builds with the fixes mentioned here can be obtained by sending email to support@chilkatsoft.com.

  • 2-April-2019 CkString: The appendHexData method would terminate with an unnecessary LF if the passed in data was a multiple of 16.
  • 2-April-2019 Imap: Fixed a problem parsing IMAP server responses when fetching emails with AutoDownloadAttachments=false where the email is empty without attachments.
  • 2-April-2019 PrivateKey: Fixed a problem reading the PEM output (Encrypted Private Key) produced by this OpenSSL command: pkcs12 -in sample.p12 -passin pass:test123 –passout pass:test1234 -out sampleKey.pem
  • 2-April-2019: ConnectFailReason property: For classes that have a ConnectFailReason property: Added the value 125 — TLS Pin Set Mismatch.
  • 4-April-2019: Emoji Chars: Fixed internal problem mainly involving emoji chars. The actual problem had to do with internal utf-8 to utf-16 conversion when surrogate pairs are present (and emoji chars are the typical chars where surrogate pairs occur). This problem could’ve presented in various ways across various classes: DirTree, Zip, FileAccess, etc.
  • 4-April-2019: XML DSig: Fixed a problem having to do with exclusive canonicalization w/ namespace emission. The problem occurred infrequently enough to be unnoticed for quite some time.
  • 5-April-2019: Scp: Fixed problems having to do with uploads where SPACE chars are in the directory or filename.
  • 5-April-2019: Scp: Fixed issue with SyncTreeUpload. Modes 1-5 would operate as mode 0 and upload all files.
  • 5-April-2019: Rest: If connecting with auto-reconnect turned on, the FullRequestMultipart did not auto-restore the connection if the request was non-chunked.
  • 8-April-2019: CkStringBuilder: Fixed the ContainsWord method for case-insensitive matches where Danish (or other non-English but Western European accented chars) are used.
  • 9-April-2019: Ftp2: Added the UncommonOptions property.
  • 12-April-2019: TCP/TLS in general: Made internal changes to hopefully get rid of “WSAECONNABORTED An established connection was aborted by the software in your host machine.” errors when sending large amounts of data on a socket. (Such as for Amazon Glacier uploads.) This change only applies for builds on the Windows operating system. Other operating systems don’t seem to have this error.
  • 16-April-2019: SshKey: Fixed FromOpenSshPrivateKey for loading non-encrypted RSA private keys.

Chilkat v9.5.0.79 Pre-Release Notes

$
0
0

The current latest stable version release notes: Chilkat v9.5.0.78 Release Notes

Chilkat v9.5.0.79 pre-Release Notes

  • 21-May-2019 HttpResponse: (fixed) The FullMime property did not return the full MIME of the HTTP response. Instead, it returned the BodyStr.
  • 27-May-2019: SFtp, Ssh: Added the LastJsonData method. This provides the ability to get additional information for some method calls. For example, after calling Connect the LastJsonData will list the algorithms used to establish the SSH connection. Also, authentication failure reason information is available for each of the Authenticate* methods.
  • 27-May-2019: Mailman: Fixed duplicate response lines from appearing in the Pop3SessionLog.
  • 27-May-2019: Mailman: Updated the Pop3SendRawCommand method to properly retrieve multiline responses such as CAPA or UIDL.
  • 30-May-2019: Rest: Fixed: ReadRespBodyStream immediately failed if the download was larger than 4GB.

Using Chilkat .NET Assembly on Shared Hosting (Plesk, such as GoDaddy)

$
0
0

Full trust is needed to use the Chilkat .NET assembly on a Windows shared hosting platform, such as GoDaddy, where Plesk is used.

To enable full trust, add the following to your web.config:

  <system.web>
    ...
    <trust level="Full" />
    ...
  </system.web>

Updating SSH Server (sshd) on MacOSX to require both password and public key authentication…

$
0
0

To update the sshd on macosx to require both password and public-key authentication, do the following…

  1. Go to /etc/ssh
  2. Edit sshd_config and add the following line:
    AuthenticationMethods publickey,password
  3. If the PasswordAuthentication line exists, make sure it is commented out:
    #PasswordAuthentication yes
  4. Restart the server by running these two commands:


sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist 
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

Downloading Super-Huge Files via FTP, SFTP, Http, etc.

$
0
0

It seems that more and more nowadays, Chilkat has customers needing to download gigantic files (many Gigabytes) using various protocols such as SFTP, FTP, or HTTP. These downloads can take a long time, even with a very good transfer rate. The longer the download time, the higher the probability that something goes wrong: network congestion, connectivity issues, server problems, etc.

Chilkat provides resume functionality for downloads in all protocols (HTTP, SFTP, FTP). This allows for a failed download to restart at the point it failed. This works by examining the byte count of the local file, and then restarting the download at that byte index for the remote file.

It is also important to have in mind a way to verify after-the-download that the local file indeed contains the exact bytes as the remote file. Many cloud storage API’s (S3, Glacier, and others) incorporate checksums (or hash values, such as SHA256). The hash of the large file on the server is made available, and then after the download the local file can be hashed, and the hash values compared to ensure your local file is identical to the remote file.

If you are hosting large files on your own FTP, SSH/SFTP, or HTTP server, I would recommend including a hash value in your system design/architecture. For example, let’s say you store a huge file named “big.zip” on your FTP server. You might also store a file named “big.zip.sha256” alongside “big.zip”. Whatever system or application originally uploads big.zip would also compute the SHA256 hash of big.zip and upload it as well. An application that downloads big.zip would also download big.zip.sha256 and then verify that the SHA256 hash of the local file matches the downloaded SHA256 hash. This is just one possible implementation idea. The point is: You want to be sure that what was downloaded, especially if the download was completed after several restarts, is an exact duplicate of the remote file.

Adyen C# HMAC Signature Calculation for Hosted Payment Page (HPP)

$
0
0

This is a C# example (Razor Pages in ASP.NET) showing how to do the HMAC signature calculation for a Adyen Hosted Payment Page…

@{
    Layout = "~/_ck_layout_adyen.cshtml";
}

@{
    Chilkat.Global glob = new Chilkat.Global();
    bool success = glob.UnlockBundle("Anything for 30-day trial");
    if (success != true) {
        @Html.Raw("<h2>Failed to unlock Chilkat</h2>");
        return;
    }

    <!-- The orderData contains the following HTML...  -->
    string orderData = @"<table class=""od"">
    <tr>
    <th>Description </th> <th>Quantity </th> <th>Amount </th>
    </tr>
    <tr>
    <td>1 Digital Camera (xyz)</td> <td class=""r"">1</td> <td class=""r"">100 GBP </td>
    </tr>
    <tr>
    <td class=""b"">Total</td> <td class=""r""></td> <td class=""b r"">100.00 GBP </td>
    </tr>
    </table>";

    Chilkat.Gzip gzip = new Chilkat.Gzip();
    string gzOrderData = gzip.CompressStringENC(orderData,"utf-8","base64");

    Chilkat.Xml xml = new Chilkat.Xml();
    xml.Tag = "keyValuePairs";

    xml.NewChild2("orderData", gzOrderData);

    // required, The payment deadline; the payment needs to occur within the specified time value.
    string sessionValidity = "2019-08-11T10:30:00Z";
    xml.NewChild2("sessionValidity", sessionValidity);

    // optional.  Normally we'll let Adyen automatically know the country based on the IP address.
    // By default, the payment methods offered to a shopper are filtered based on the country the shopper's IP address is mapped to. 
    // In this way, shoppers are not offered payment methods that are not available in the country they are carrying out the transaction from. 
    // This IP-to-country mapping is not 100% accurate, so if you have already established the country of the shopper, you can set it explicitly 
    // in the countryCode parameter.
    string countryCode = "GB";
    xml.NewChild2("countryCode", countryCode);
 
    // optional
    string shopperLocale = "en_GB";
    // If not specified, the locale preference is set to en_GB   by default.
    // When it is not necessary to include the country-specific part, use only the language code.
    // For example: it instead of it_IT to set the locale preferences to Italian.
    xml.NewChild2("shopperLocale", shopperLocale);

    // required, A reference to uniquely identify the payment. This reference is used in all communication with you about the payment status. 
    // We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, 
    // you can enter them in this field. Separate each reference value with a hyphen character ("-"). This field has a length restriction: 
    // you can enter max. 80 characters.
    string merchantReference = "paymentTest1234";
    xml.NewChild2("merchantReference", merchantReference);

    // required, The merchant account identifier you want to process the (transaction) request with.
    string merchantAccount = "ChilkatSoftwareIncCOM";
    xml.NewChild2("merchantAccount", merchantAccount);

    // required.  10000 for $100.00
    string paymentAmount = "10000";
    xml.NewChild2("paymentAmount", paymentAmount);

    // required, The three-character ISO currency code
    string currencyCode = "GBP";
    xml.NewChild2("currencyCode", currencyCode);

    // required.
    string skinCode =  "S5uVskfB";
    xml.NewChild2("skinCode", skinCode);

    // optional, A unique identifier for the shopper, for example, a customer ID.
    // We recommend providing this information, as it is used in velocity fraud checks. It is also the key in recurring payments.
    // This field is mandatory in recurring payments.  
    string shopperReference = "somebody@example.com";
    xml.NewChild2("shopperReference", shopperReference);

    // optional
    string shopperEmail = "somebody@example.com";
    xml.NewChild2("shopperEmail", shopperEmail);

    // optional, An integer value that adds up to the normal fraud score.
    // The value can be either a positive or negative integer.
    xml.NewChild2("offset", "0");

    // Apparently this is a required field.
    string shipBeforeDate = "2019-06-04";
    xml.NewChild2("shipBeforeDate", shipBeforeDate);

    xml.SortByTag(true);

    // Encode...
    //  "\" (backslash) as "\\"
    //  ":" (colon) as "\:"

    System.Text.StringBuilder sbTags = new System.Text.StringBuilder();
    System.Text.StringBuilder sbValues = new System.Text.StringBuilder();

    int n = xml.NumChildren;
    for (int i = 0; i < n; i++)
        {
        if (i > 0)
            {
            sbTags.Append(":");
            sbValues.Append(":");
            }
        xml.GetChild2(i);
        sbTags.Append(xml.Tag);
        sbValues.Append(xml.Content.Replace("\\", "\\\\").Replace(":", "\\:"));
        xml.GetParent2();
        }
    
    string signingStr = sbTags.ToString() + ":" + sbValues.ToString();

    Chilkat.Crypt2 crypt = new Chilkat.Crypt2();
    crypt.HashAlgorithm = "sha256";
    crypt.MacAlgorithm = "hmac";

    string hmacKey = "831D1D807DDD99596EB430076FD7F8E2D12D0A3F5024304C0C389A703618F749";
    crypt.SetMacKeyEncoded(hmacKey, "hex");

    crypt.EncodingMode = "base64";
    string merchantSig = crypt.HmacStringENC(signingStr);

    // You can test the HMAC Calculation by submitting a payment request to https://ca-test.adyen.com/ca/ca/skin/checkhmac.shtml

    string paymentRequestUrl = "https://test.adyen.com/hpp/select.shtml";

}



    <form method="post" action=@paymentRequestUrl id="adyenForm" name="adyenForm" target="_parent">
      <input type="hidden" name="orderData" value=@gzOrderData>
      <input type="hidden" name="merchantSig" value=@merchantSig />
      <input type="hidden" name="sessionValidity" value=@sessionValidity />
      <input type="hidden" name="shipBeforeDate" value=@shipBeforeDate />
      <input type="hidden" name="shopperLocale" value=@shopperLocale />
      <input type="hidden" name="merchantAccount" value=@merchantAccount />
      <input type="hidden" name="paymentAmount" value=@paymentAmount />
      <input type="hidden" name="currencyCode" value=@currencyCode />
      <input type="hidden" name="skinCode" value=@skinCode />
      <input type="hidden" name="countryCode" value=@countryCode />
      <input type="hidden" name="merchantReference" value=@merchantReference />
      <input type="hidden" name="shopperReference" value=@shopperReference />
      <input type="hidden" name="shopperEmail" value=@shopperEmail />
      <input type="hidden" name="offset" value="0" />
      <input type="submit" value="Send" />
      <input type="reset" />
    </form>

XML Signature / Canonicalization Bug in Widely Used Software

$
0
0

Chilkat has found what it believes to be a bug in the internal XML canonicalization functionality in some other software systems.

Chilkat’s XML canonicalization is correct, whereas some other established implementations are incorrect. Chilkat is adding a Behavior in v9.5.0.79 to allow for the bug to be reproduced so that XML signatures produced by Chilkat are compatible with these particular systems.

The bug has to do with the sorting of attributes in XML canonicalization. Specifically, the rules for sorting attributes are described here: https://www.w3.org/TR/xml-c14n11/#DocumentOrder

  • An element’s attribute nodes are sorted lexicographically with namespace URI as the primary key and local name as the secondary key (an empty namespace URI is lexicographically least).

For example, if we have the following XML:

<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<value value="20" xsi:type="PQ"></value>
</ClinicalDocument>

The canonicalized XML is this:

<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<value xsi:type="PQ" value="20"></value>
</ClinicalDocument>

Notice the order of the attributes “value” and “xsi:type” are reversed. Why is this? It’s because the attributes are first sorted by the primary key. The primary key is the namespace URI. The “value” attribute uses the default namespace, and in this case the default namespace URI is “urn:hl7-org:v3”. The namespace URI of the “xsi:type” attribute is “http://www.w3.org/2001/XMLSchema-instance”.

Therefore, we compare “http://www.w3.org/2001/XMLSchema-instance” with “urn:hl7-org:v3”. Based on this comparison, the “xsi:type” attribute comes first. This is what Chilkat does, and it is correct according to the XML canonicalization standards.

Apparently, some existing XML signature implementations simply compare “xsi:type” with “value” and sort based on the simple comparison. This is incorrect. To force Chilkat to create an XML signature in this incorrect way, the “AttributeSortingBug” keyword can be added to the Behaviors property (starting in Chilkat v9.5.0.79).


Electron: Uncaught Error: A dynamic link library (DLL) initialization routine failed.

$
0
0

Customer problem:

Hi having trouble getting @chilkat/ck-electron4-win64 working. Im getting this error:

Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Users\User\Documents\xyz\node_modules\@chilkat\ck-electron4-win64\chilkat.node

Resolution:

I’m unable to reproduce the problem. Here are the steps taken to install Electron 4.0.4 and use Chilkat from scratch…

using the Electron quick start as shown here:  https://github.com/electron/electron-quick-start

(1) Start the GitHub Bash shell

(2) Go to /c/Users/admin/electron-quick-start
$ npm install electron@4.0.4

(3) To run Hello World:
$ npm start

(4) Install Chilkat..
$ npm install @chilkat/ck-electron4-win64

(5) Open main.js and add the following at the top:

var os = require('os');
var chilkat = require('@chilkat/ck-electron4-win64');

(6) Add the following lines in createWindow() just to test something w/ Chilkat

     var sb = new chilkat.StringBuilder();
sb.Append("hello world");
sb.WriteFile("hello.txt","utf-8",false);

(7) Rebuild and run.

Getting Started with Chilkat in the Go Language (Linux 64-bit)

$
0
0

This is a walkthrough for getting a “Hello World” working with Chilkat in the Go programming language.
We’ll start from scratch by downloading Go and getting a simple Hello World Go example working. Then we’ll install Chilkat and build and run an example program.

(1) My Go language installation will be in ~/langDists/go.

cd ~
mkdir langDists
cd langDists

(2) Download Go and unpack.

wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
tar xzf go1.12.7.linux-amd64.tar.gz

(3) Edit your .profile by adding these lines. Then restart your shell session..

(The GOPATH will be used in the next steps, but we’ll set it here..)

GOROOT=$HOME/langDists/go
PATH="$PATH:$GOROOT/bin"
GOPATH=$HOME/go

(4) Create a directory (~/go/src/hello) where we’ll create a simple “hello” Go program.

cd ~
mkdir go
cd go
mkdir src
cd src
mkdir hello

(5) Create the file ~/go/src/hello/hello.go containing this content

package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}

(6) Build and run

cd ~/go/src/hello
go build
./hello

If all is OK, proceed…

(7) Download chilkat_go.zip and unzip. (The download link should be updated to the latest version of Chilkat. See https://www.chilkatsoft.com/go.asp

cd $GOPATH/src
wget https://chilkatdownload.com/9.5.0.78/chilkat_go.zip
unzip chilkat_go.zip

(8) Download the Native “C” Chilkat Go library for 64-bit Linux

Make sure the Chilkat version matches the version downloaded for chilkat_go.zip.

cd $GOPATH/src
mkdir chilkatLib
cd chilkatLib
wget https://chilkatdownload.com/9.5.0.78/chilkatext-9.5.0-linux-x64-gcc.tar.gz
tar xzf chilkatext-9.5.0-linux-x64-gcc.tar.gz

(9) Set $CGO_LDFLAGS as shown here. (Add this line to your .bashrc)

export CGO_LDFLAGS="-L$HOME/go/chilkatLib/linux-x64-gcc -lchilkatext-9.5.0 -lresolv -lpthread -lstdc++"

(10) Build the “chilkat” package.
The “go build” will take some time.

cd $GOPATH/src/chilkat
go build
go install

(11) Build and Run an Example Program

cd $GOPATH/src/chilkat_example1
go build
./chilkat_example1

The output for the chilkat_example1 should be some XML followed by a line indicating “success”.

Android Java .so Shared Lib sizes, and Android C++ Linker Options to Minimize Size

$
0
0

The Chilkat v9.5.0.79 version reduces the size of the Android Java .so shared libs by approximately 24%. For example, the armv7l lib is reduced from 9.86MB to 7.56MB.

For developers writing C++ code in Android (i.e. using the Android C++ libs downloaded from https://www.chilkatsoft.com/chilkatAndroidCpp.asp), you’ll want to include the following linker options when linking with the Chilkat static libs:

-Wl,--gc-sections,--icf=safe

For the arm64 architecture, omit the “,–icf=safe”

-Wl,--gc-sections

Chilkat v9.5.0.80 Pre-Release Notes

$
0
0

The previous version release notes: Chilkat v9.5.0.79 Release Notes

Chilkat v9.5.0.80 Release Notes

  • 9-Aug-2019 Apple WatchOS: Added the static library for the arm64_32 architecture.  Pre-release download is at: https://chilkatdownload.com/prerelease/chilkat-9.5.0-watchos-1494.zip
  • 9-Aug-2019 iOS: Added an “iPad Apps for Mac” build.   This is a new set of Chilkat iOS libs built with Xcode 11.0 beta 5, on macOS Catalina (version 10.15 beta). This download contains the iOS libs for the usual architectures (armv7s, armv7, i386, and x86_64) but also contains a static lib build with UIKit for Mac. It is located in the lib/ipad_for_mac subdirectory.  Pre-release download is at https://chilkatdownload.com/prerelease/chilkat-9.5.0-ipad_for_mac-1492.zip
  • 10-Aug-2019  CertStore:  Added the OpenSmartcard method.   This is a Windows-only method that provides access to the certificates on the smart card currently inserted into the reader.   (Can also be used with a USB token.)

iPad Simulator: Undefined symbols for architecture x86_64: _readdir$INODE64

$
0
0

Question:

We are currently seeing the following error when we run the build on iPad Simulator

Undefined symbols for architecture x86_64:
"_readdir$INODE64", referenced from:
  _ckFileList2::addDirNonRecursive2(int, FileMatchingSpec&, ExtPtrArrayXs&, ProgressMonitor*, LogBase&) in libchilkatIos.a(fileList.o)
  _ckFindFile::advancePositionLinux(char const*, LogBase&) in libchilkatIos.a(fileList.o)
"_opendir$INODE64", referenced from:
  _ckFindFile::ffOpenDir2(XString&, LogBase&) in libchilkatIos.a(fileList.o)
  _ckFileList2::addDirNonRecursive2(int, FileMatchingSpec&, ExtPtrArrayXs&, ProgressMonitor*, LogBase&) in libchilkatIos.a(fileList.o)
ld: symbol(s) not found for architecture x86_64

Answer:

You can fix this by adding the following functions to any of your Objective-C, C or C++ source files for your project. We added them to our main.mm:

// Functions that appear to be missing when targeting the Xcode iOS Simulators
// These are used by the Corona SDK OpenSSL plugin</code>

#include <dirent.h>
#include <fnmatch.h>

extern "C" DIR * opendir$INODE64( char * dirName );
DIR * opendir$INODE64( char * dirName )
{
return opendir( dirName );
}

extern "C" struct dirent * readdir$INODE64( DIR * dir );
struct dirent * readdir$INODE64( DIR * dir )
{
return readdir( dir );
}
Viewing all 414 articles
Browse latest View live