StephenHardy Posted February 3, 2014 Posted February 3, 2014 Hi Folks, I have a 2 node Server 2012 R2 NLB cluster and I am trying to get HAP working on this. Individually both servers work with HAP absolutely fine, so I don't think its an issue with HAP per se, however, when I access through the NLB DNS Name/IP and open 'My Files' I get "Padding is invalid and cannot be removed." down the right of the screen multiple times if I click on any of the drive links, with the following error enter in the Event Logs: An error occurred in Home Access Plus+ Page: mscorlib Padding is invalid and cannot be removed. System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.StreamReader.Dispose(Boolean disposing) at System.IO.TextReader.Dispose() at HAP.AD.TokenGenerator.ConvertToPlain(String token) at HAP.MyFiles.API.info(String Drive, String Path) at SyncInvokeinfo(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.StreamReader.Dispose(Boolean disposing) at System.IO.TextReader.Dispose() at HAP.AD.TokenGenerator.ConvertToPlain(String token) at HAP.MyFiles.API.info(String Drive, String Path) at SyncInvokeinfo(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) Any clues? Thanks Stephen
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 When Using Firebug in Firefox I get the following: 400 An WCF Error has Occured {"Message":"Padding is invalid and cannot be removed.","Detail":null,"FaultType":"CryptographicException"} Response Headers Cache-Control private Content-Length 106 Content-Type application/xml; charset=utf-8 Server Microsoft-IIS/8.5 X-AspNet-Version 4.0.30319 X-Powered-By ASP.NET Date Tue, 04 Feb 2014 09:28:05 GMT Request Headers Host swc-web-nlb01 User-Agent Mozilla/5.0 (Windows NT 6.2; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 Accept application/json, text/javascript, */*; q=0.01 Accept-Language en-gb,en;q=0.5 Accept-Encoding gzip, deflate DNT 1 Content-Type application/json X-Requested-With XMLHttpRequest Referer https://myserverurl/hap/myfiles/ Cookie ASP.NET_SessionId=21k2p1k2fx0nw2hsdnqornoq; .ASPXAUTH=B8B3BC70E331CD1976AB39D94FFFE7B6CFC2E4564FF8A3B1F8B7B7F819B6478DF4DC26CE6AEE9FB6AB4E3A1C372F384F51A543D6A2835CDE88021AB2D4581BC2E469771B96DE2F439EE6EDE0408B68BDC81747D764022C59E3DC5825914CAC141507D707B8A601BA9528843485A8C3C158C96F11CCE315F4942807A4DAC3115196FA7E6DFFF360EE4646256C60A46A7B; token=ASDHztn6v3GcZVv8trZSNw== Looks like an issue with encryption and decryption using the Rijndael object - strange however as it works if I just go straight to the individual servers themselves....
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 sorted folks - I installed all components of IIS role and all components of .net3.5 & 4.5 features - working now
nickbro Posted February 4, 2014 Posted February 4, 2014 HAP+ uses some machine specific info for some of the encryption stuff. I'll add the option to allow it to use a preset key that you can make.
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 Cheers Nick - looks sorted now though after installing all components for IIS & .net 3.5/4.5 for server 2012 Going to work on getting the booking system up next
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 oops tell a lie - not working now! Yeah Nick if you could I can give that a try.
fairm010 Posted February 4, 2014 Posted February 4, 2014 I had huge issues trying to get HAP working on Server 2012 including this problem but 2008 R2 is flawless so I use that.
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 This is the only issue I've got, I agree, Server 2008R2 version was bullet proof, I just couldn't give 1 server enough resources and put together a load balanced solution that allows me to deliver other products in the same set of servers, i.e. moodle/RD Web Applications etc. It works on each individual Server 2012R2 server if it helps you - I followed the instructions and then copied over my styling from my Server 2008R2 server, its only when I've come to cluster access the site its throws this one issue Nick has a really good product here and we really like it so ideally I'd like it to run on the Server 2012R2 cluster we have - and it seems as though Nick has plan on how to work around this, so should be good
fairm010 Posted February 4, 2014 Posted February 4, 2014 Agreed, Its brilliant and it is our sole remote access solution (Along with RemoteApp).
nickbro Posted February 4, 2014 Posted February 4, 2014 I know how to fix it, it just wont be fixed until the v10 release. You will also need to set a machine key in the web.config file so ASP.net can share session keys. ASP.NET Machine Key Generator - developer Fusion ASP.net version 2 should do the trick. But that's just asp.net, HAP+ is another story and it'll be something like 1
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 Cheers Nick, I'll take a look at this later
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 Out of interest... V10... Any ETA dates?
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 so something like: Where would this go?
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 tried this in the Hap.config file - no dice
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 ahhh OK - I'll hold my horses then I'll leave my 2008R2 HAP install where it is for now Any ETA on v10? Cheers Nick
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 I'd like to offer my cluster for testing if you need it mate , it's not doing an awful lot else right now 😁
nickbro Posted February 4, 2014 Posted February 4, 2014 Right, the plan is you will need a key and a salt, as well as doing the asp.net machine key stuff. The plan is, by default these will not be visible or shown or have any value, at which point HAP+ auto generates them based on the machine name, but you can override HAP+. Suggestion is go to Random String Generator | Strong Password Generator The Salt will be one of the Alphanumeric + special character strings The Key will be all of the Alphanumeric + special character strings on the page So at the time of writing a test Salt would be: dfcjtyxYA!l#3um1 and the Key would be: eGGb49-nZ+JFo.?2emQEHifDKlG@oiEDZ7O@fBc1oWFNTzO?VrypKN@g!w6iPKVARwq=!C=jly=1!H!Q_s2F3%W.n*g,y,zbuZ5po.IJvBJq5D31=5F__o=ic0hL8QWC
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 OK buddy, so where do I put this - i'll test with the test ones you listed above and then generate my own when its working
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 Also - I take it the ASP machine key stuff is simply the machine key setting in ASP.net for the site?
nickbro Posted February 4, 2014 Posted February 4, 2014 Machine Key: Yep The other won't be out until v10, so hold off on that for a mo
StephenHardy Posted February 4, 2014 Author Posted February 4, 2014 to be honest, I don't have a clue where to put the salt and key, the machine key for IIS auto adds the Encryption and decryption key to the HAP config.... can you elaborate for me?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now