Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to avoid Connection Failure with cfhttp...

Posted on 2009-07-04
2
Medium Priority
?
1,140 Views
Last Modified: 2013-12-20
Expert Needed:

I have a post and it gets a connection failure -popped up outa nowhere. It was working fine.

I created a page that basically submits a form automated sumbit with all hidden fields and it works fine, same form fields. Any Suggestions from the experts? I need the cfhttp to work.
<!--- This gets a coonection failure: --->
<cfhttp url="https://URL.aspx" method="post"> 
<cfhttpparam type="FORMFIELD" name="Name" value="Nick Sabane">
<cfhttpparam type="FORMFIELD" name="Address" value="101 Main st">
<cfhttpparam type="FORMFIELD" name="City" value="Mobile">
<cfhttpparam type="FORMFIELD" name="State" value="AL">
<cfhttpparam type="FORMFIELD" name="Zip" value="35444">
<cfhttpparam type="FORMFIELD" name="Phone" value="2563417449">
<cfhttpparam type="FORMFIELD" name="Email" value="123@aol.biz">
<cfhttpparam type="FORMFIELD" name="Company" value="My Company">
</cfhttp>
 
 
<cfoutput>#cfhttp.FileContent#</cfoutput>
 
This works:
<cfform action="https://URL.aspx" method="post" name="form1" target="_self">
<input name="Name" type="hidden" value="Nick Sabane" />
<input name="Address" type="hidden" value="115 Main st" />
<input name="City" type="hidden" value="Mobile" />
<input name="State" type="hidden" value="AL" />
<input name="Zip" type="hidden" value="35444" />
<input name="Phone" type="hidden" value="2563417449" />
<input name="Email" type="hidden" value="123@aol.biz" />
 
<input name="Company" type="hidden" value="My Company" />
<script>
document.form1.submit();
</script>
</cfform>

Open in new window

0
Comment
Question by:LeadCo
2 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 2000 total points
ID: 24779017
form post using cfhttp to a secure page can be tricky, especially if the page/web service requires client certificates...

here's from CFML Reference Manual:

"To use HTTPS with the cfhttp tag, you might need to manually import the certificate for each web server into the keystore for the JRE that ColdFusion uses. This procedure should not be necessary if the certificate is signed (issued) by an authority that the JSSE (Java Secure Sockets Extension) recognizes (for example, Verisign); that is, if the signing authority is in the cacerts already. However, you might need to use the procedure if you are issuing SSL (secure sockets layer) certificates yourself.
Manually import a certificate
1     Go to a page on the SSL server in question.
2     Double-click the lock icon.
3     Click the Details tab.
4     Click Copy To File.
5     Select the base64 option and save the file.
6     Copy the CER file into C:\CFusionMX7\runtime\jre\lib\security (or whichever JRE ColdFusion is using).
7     Run the following command in the same directory (keytool.exe is located in C:\CFusionMX7\runtime\jre\bin): keytool -import -keystore cacerts -alias giveUniqueName -file filename.cer"

you should check with the service provider if you have to include any SSL client certs, or any other data in the manual post (i.e. it may require a cookie, or a valid user agent, or something else) - cfhttp does not send any of that data by itself.

Azadi
0
 

Author Closing Comment

by:LeadCo
ID: 31599877
Thanks good to know!!!!
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question