Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to avoid Connection Failure with cfhttp...

Posted on 2009-07-04
2
Medium Priority
?
1,135 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 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
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…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

721 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