Solved

How to avoid Connection Failure with cfhttp...

Posted on 2009-07-04
2
1,131 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 500 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

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

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

Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
What You Need to Know when Searching for a Webhost Provider
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

635 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