Coldfusion 7 peer not authenticated error

Have you ever seen the error message “ErrorDetail I/O Exception: peer not authenticated” when working with Coldfusion 7′s CFHTTP?  I hadn’t until recently, and it turns out I found an interesting bug with Coldfusion7 running on top of Windows 2003.

I ran into this while building a PayPal payment processor, and wasted too much time thinking this was a username and password issue, or possibly a problem with the host name I was using, but it wasn’t.  It was extra frustrating because my test PayPal code worked just fine if I created an html form and posted directly to PayPal.  Also, the same code worked perfectly in production, just not on my development server.

After hours of googling and trial and error I found my solution thanks to Steve Erat.  Basically Coldfusion 7 isn’t able to handshake securely with PayPal ( Verisign ) because the server doesn’t have PayPal’s certificate in the key store.  You can read in depth about what’s happening on Steve’s blog post here.

So my solution ended up being this

  1. Download the verisign.cer certificate from my production server
  2. Import verisign.cer into the JDK that comes with Coldfusion
  3. Restart Coldfusion and IIS

I tried all sorts of things from installing every windows certificate management features, upgrading my JDK and having Coldfusion use that, apply all the latest service packs and updates to my server, changing any paypal setting I can think of.  All I needed to do was this.

  1. Drop to CMD prompt
  2. Run the keytool that came installed with Coldfusion
    “C:CFusionMX7runtimejrebinkeytool -import -trustcacerts -keystore C:CFusionMX7runtimejrelibsecuritycacerts -storepass changeit -noprompt -alias PayPal -file c:verisign.cer”

I couldn’t find this solution anywhere else online besides Steve’s site, so this is a rebroadcast in case somebody else hits this issue.  Also, at the time of writing, the test payment hostname for PayPal is pilot-payflowpro.paypal.com.

PayPal test credit card numbers

<!–[CDATA[

Test Credit Card Account Numbers

While testing, use only the credit card numbers listed here. Other numbers produce an error.

Expiration Date

must be a valid date in the future (use the mmyy format).

Test Credit Card Account Numbers

Credit Card Type

Credit Card Number

American Express

378282246310005

American Express

371449635398431

American Express Corporate

378734493671000

Australian BankCard

5610591081018250

Diners Club

30569309025904

Diners Club

38520000023237

Discover

6011111111111117

Discover

6011000990139424

JCB

3530111333300000

JCB

3566002020360505

MasterCard

5555555555554444

MasterCard

5105105105105100

Visa

4111111111111111

Visa

4012888888881881

Visa

4222222222222

Note : Even though this number has a different character count than the other test numbers, it is the correct and functional number.

Processor-specific Cards

Dankort (PBS)

76009244561

Dankort (PBS)

5019717010103742

Switch/Solo (Paymentech)

6331101999990016

Permalink

| Leave a comment

2 of 10,388 days remaining #TRON

<!–[CDATA[

– Using tsql to figure out how long until TRON:LEGACY

DECLARE @tron datetime,
@tron_legacy datetime
SET @tron = ’7/9/1982 12:00:00′
SET @tron_legacy = ’12/17/2010 12:00:00′
SELECT CAST( DATEDIFF( DD, GETDATE(), @tron_legacy ) as varchar(2) ) + ‘ of’ + CAST ( DATEDIFF( DD, @tron, @tron_legacy ) AS VARCHAR(1000) ) + ‘ days remaining’ as ‘How long until TRON:LEGACY?’
– returns
– 2 of10388 days remaining

Permalink

| Leave a comment

TSQL : How to find all database tables ending with an UPPERCASE X

<![CDATA[

1
2
3
4
5
6
7
8
9
10
-- Give me all tables ending with an UPPERCASE X

SELECT table_name, SUBSTRING( table_name, LEN(table_name), 1 ) as 'end'

FROM INFORMATION_SCHEMA.TABLES

-- SELECT ascii('X') = 88
-- SELECT ascii('x') = 120
WHERE ASCII( SUBSTRING( table_name, LEN(table_name), 1 ) ) = 88

Permalink

|