• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

BinaryWrite and SSL

I'm creating a PDF file on the fly and feeding it to the browser using BinaryWrite. The website is secure (runnng SSL) and when the page displays it pops up the message:

"This page both secure and non-secure items. Do you want to display the non-secure items?"

How can i make sure the binary feed u=is encrypted?
0
tomhoran
Asked:
tomhoran
  • 10
  • 8
1 Solution
 
markhoyCommented:
Is the binary write (the source of the PDF) coming from the SSL folder? ie a SECURE folder?
0
 
tomhoranAuthor Commented:
i would have to say yes. the ssl is www.repayme.com and then the folder for the binarywrite comes from

www.repayme.com/admin/reports/binarywritepgm.asp (not the real name)
0
 
markhoyCommented:
so they are both https:// ? including the source that you read to make the pdf? There was a post similar to this recently- I did a search on the archives but couldn't find it..

Have you looked at any tech articles on thawte.com or openssl.org?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
tomhoranAuthor Commented:
no. I'm using crystal to create the .pdf file stream, here is my code:


Set oApp = Server.CreateObject("CrystalRuntime.Application.9")
Path = Request.ServerVariables("PATH_TRANSLATED")                    
While (Right(Path, 1) <> "\" And Len(Path) <> 0)                      
     iLen = Len(Path) - 1                                                  
     Path = Left(Path, iLen)                                              
Wend

Set oRpt = oApp.OpenReport(Path & ReportName, 1)
Set oPageEngine = oRpt.PageEngine
Pagehelper = Array()
Set oPageGenerator = oPageEngine.CreatePageGenerator(PageHelper)

recordsel = "{reimburse_check.delivery_method} = 'L' " & _
     "and {reimburse_check.cust_no} = '" & custno & "' " & _
     "and {reimburse_check.process_no} = " & whichproc & _
     whichcmp
oRpt.RecordSelectionFormula = CStr(recordsel)

oRpt.ParameterFields.GetItemByName("plain_paper").AddCurrentValue(CStr(plainpaper))
oRpt.ParameterFields.GetItemByName("test_check").AddCurrentValue(CStr(testcheck))

'///////////////////////////////////////////////////////////
'//  Use the report object and the export options object  //
'//  to set up the export type and destination.         //
'///////////////////////////////////////////////////////////

With oRpt
     .MorePrintEngineErrorMessages = False
     .EnableParameterPrompting = False
          With .ExportOptions
               .DestinationType = DestinationType
               .FormatType = FormatType
          End With
End With

With Response
     .Expires = 0
     .Buffer = True
     .Clear
     .ContentType = "application/pdf"
     .BinaryWrite oPageGenerator.Export(8209)
End With
0
 
tomhoranAuthor Commented:
no. I'm using crystal to create the .pdf file stream, here is my code:


Set oApp = Server.CreateObject("CrystalRuntime.Application.9")
Path = Request.ServerVariables("PATH_TRANSLATED")                    
While (Right(Path, 1) <> "\" And Len(Path) <> 0)                      
     iLen = Len(Path) - 1                                                  
     Path = Left(Path, iLen)                                              
Wend

Set oRpt = oApp.OpenReport(Path & ReportName, 1)
Set oPageEngine = oRpt.PageEngine
Pagehelper = Array()
Set oPageGenerator = oPageEngine.CreatePageGenerator(PageHelper)

recordsel = "{reimburse_check.delivery_method} = 'L' " & _
     "and {reimburse_check.cust_no} = '" & custno & "' " & _
     "and {reimburse_check.process_no} = " & whichproc & _
     whichcmp
oRpt.RecordSelectionFormula = CStr(recordsel)

oRpt.ParameterFields.GetItemByName("plain_paper").AddCurrentValue(CStr(plainpaper))
oRpt.ParameterFields.GetItemByName("test_check").AddCurrentValue(CStr(testcheck))

'///////////////////////////////////////////////////////////
'//  Use the report object and the export options object  //
'//  to set up the export type and destination.         //
'///////////////////////////////////////////////////////////

With oRpt
     .MorePrintEngineErrorMessages = False
     .EnableParameterPrompting = False
          With .ExportOptions
               .DestinationType = DestinationType
               .FormatType = FormatType
          End With
End With

With Response
     .Expires = 0
     .Buffer = True
     .Clear
     .ContentType = "application/pdf"
     .BinaryWrite oPageGenerator.Export(8209)
End With
0
 
markhoyCommented:
I think it's because the crystal dll is in the system folder and not the ssl folder so when it is called you get the message. I wish I could find the post from the other week... Are you able to copy and register the Crystal dll in the SSL folder?
0
 
tomhoranAuthor Commented:
not sure that's the problem as their activex view doesn't have this problem.

i talked with them and they mentioned that it had to do with the header or something not being created before the binary string was hitting the browser.
0
 
markhoyCommented:
can you use a server.execute to make the file on the fly and then read it?
0
 
tomhoranAuthor Commented:
what would that do for me? what does "server.execute" do?
0
 
markhoyCommented:
don't quote me (see the msdn site on "25 ways to improve web site performance"..
http://msdn.microsoft.com/workshop/server/asp/asptips.asp) but I think it's an IIS5 way of executing a server file ie an asp file within the body of an asp page- so you might be able to make the pdf that way
0
 
jSkipBCommented:
The PDF file doesn't contain any http: references, like images et al, does it?
0
 
tomhoranAuthor Commented:
no images at all. if i save it to a file then display it via a href it displays with no problems.
0
 
markhoyCommented:
Tom,

see here for server.execute:

http://www.4guysfromrolla.com/webtech/042602-1.shtml
0
 
tomhoranAuthor Commented:
I got this thing figured out...I know where the problem is, just don't know why.

Here are the steps:

1: I have a window with a hyper-link. When it's clicked it opens a new window (wk1.asp), which is secure as the lock is in the status bar.

2: This new window (wk1.asp) allows the user to select what they want to include in the .pdf file/report. They fill in some fields then click a button which then does a response.redirect to wk2.asp (I've also confirmed that it's an issue when using a form/submit)

3: wk2.asp has the code to create the response.BinaryWrite and this is where/when I get the "This page both secure and non-secure items. Do you want to display the non-secure items?"

The interesting thing is, if I do a hyper link to wk2.asp instead of a response.redirect or submit I don’t get the error???
0
 
markhoyCommented:
when you submit the form or use a redirect, are you using the full https://www.dom.com/w2k.asp ?
0
 
tomhoranAuthor Commented:
no. I don't do that with any of the other 200+ pages in the system. the page is is already within the secure site, so it shouldn't be needed
0
 
tomhoranAuthor Commented:
just for the heck of it i added the https:// on the submit and same error occured
0
 
markhoyCommented:
I know this'll sound odd, have you tried recreating the page from scratch on overwriting the old file? Strange one!
0
 
tomhoranAuthor Commented:
Thanks for your help
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 10
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now