Created
November 27, 2019 12:14
-
-
Save bennadel/5caedc52b05d397ed97fe5fd7772487b to your computer and use it in GitHub Desktop.
Fixing Connection Failure: Unable To Determine MIME Type Errors With sslCertificateInstall() In Lucee CFML 5.3.3.62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// This is the local development environment that we'll be hitting via CFHTTP. | |
domain = "projects.local.invisionapp.com"; | |
// Examine the collection of SSL Certificates installed on THIS server for the given | |
// target domain. | |
for ( cert in sslCertificateList( domain ) ) { | |
dump( cert ); | |
} | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// This is the local development environment that we'll be hitting via CFHTTP. | |
domain = "projects.local.invisionapp.com"; | |
// ------------------------------------------------------------------------------- // | |
// ------------------------------------------------------------------------------- // | |
// When this "traffic simulator" starts to run, the HTTP service won't be able to | |
// contact the local development environment since it uses a self-signed certificate. | |
// As such, if this is the first run of the traffic simulator, let's install the SSL | |
// certificate that is being used by the local development server. | |
if ( isNull( url.startedAt ) ) { | |
sslCertificateInstall( domain ); | |
} | |
// ------------------------------------------------------------------------------- // | |
// ------------------------------------------------------------------------------- // | |
// At this point, we should be OK to start making HTTP requests. | |
// -- | |
// NOTE: I am NOT trying to create load-test here. I'm only trying to create a steady | |
// stream of traffic so that I can test some New Relic metrics locally. As such, it | |
// doesn't matter that any one request here will block the next one. | |
for ( i = 0 ; i < 10 ; i++ ) { | |
trafficRequest = new Http( | |
method = "GET", | |
url = "https://#domain#/d/ben/default" | |
); | |
trafficResult = trafficRequest.send().getPrefix(); | |
echo( trafficResult.fileContent & "<br />" ); | |
cfflush( interval = 1 ); | |
sleep( randRange( 10, 50 ) ); | |
} | |
</cfscript> | |
<cfoutput> | |
<script type="text/javascript"> | |
// Refresh the page for the next batch of simulated traffic requests. | |
window.location.href = "#cgi.script_name#?startedAt=#getTickCount()#"; | |
</script> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment